At the beginning of the 16th century, the Muslim
Sultanate of Gujarat was the principal seapower in India. Gujarat fought the Portuguese fleets in collaboration with the
Mamluk Sultanate. The Portuguese were defeated by a combined Mamluk-Gujarati fleet in 1508, which was in turn destroyed by a Portuguese fleet in the
Battle of Diu (1509). The Portuguese again attempted to
capture the city in 1531. While the Ottoman-Gujarati defenders successfully withstood the siege, victory was short-lived. In 1535
Sultan Bahadur of Gujarat concluded a peace treaty with the Portuguese, allowing them to build a fort at Diu. By 1536, the Portuguese had gained complete control of Diu, while the Sultanate of Gujarat was under attack from the
Mughals. In 1538, the
Ottoman Empire, which had taken over
Egypt (1517) and
Aden (1538) from
Mamluk Egypt, joined hands with the Gujarat Sultanate to launch an anti-Portuguese offensive. They
besieged Diu in 1538, but had to retreat. ==The siege==