He spent nine months on the islands, much longer than he had intended. As a Chief Qadi, his skills were highly desirable in the formerly Buddhist nation that had recently converted to Islam. Half-kidnapped into staying, he became chief judge and married into the royal family of Omar I. He became embroiled in local politics and left when his strict judgments in the laissez-faire island kingdom began to chafe with its rulers. In the Rihla he mentions his dismay at the local women going about with no clothing above the waist, and the locals taking no notice when he complained. From the Maldives, he carried on to Sri Lanka and visited Sri Pada and Tenavaram temple.