In 1330, under the Jarwanid dynasty, the island became a tributary of the Kingdom of Hormuz. The town of Manama was mentioned by name for the first time in a manuscript dating to 1345 AD. Bahrain, particularly Manama and the nearby settlement of Bilad Al Qadeem, became a centre of Shia scholarship and training for the ulema, it would remain so for centuries. The ulema would help fund pearling expeditions and finance grain production in the rural areas surrounding the city. In 1521, Bahrain fell to the expanding Portuguese Empire in the Persian Gulf, having already defeated Hormuz. The Portuguese consolidated their hold on the island by constructing the Bahrain Fort, on the outskirts of Manama. After numerous revolts and an expanding Safavid empire in Persia, the Portuguese were expelled from Bahrain and the Safavids took control in 1602.