By the middle of the second millennium, however, Moroni was clearly a well established town, engaged in trade networks throughout the Indian Ocean, and the Badjanani mosque, built in 1427, is a testament to the city's wealth, contemporary with the golden ages of other Swahili cities. Together with neighbouring port and royal capital Ikoni, Moroni was one of two centres of economic and political power of the kingdom of Bambao. Nevertheless, until the end of the nineteenth century it was just one of a number of large towns on the island, and it wasn't until the Sultan of Bambao, Said Ali ibn Said Omar, negotiated a treaty of Protectorate with France in 1886 that his town became the seat of the colonial administration.