In 1510, the Portuguese defeated the ruling Bijapur sultan Yusuf Adil Shah with the help of a local ally, Timoji, a privateer. They set up a permanent settlement in Velha Goa. This was the beginning of Portuguese colonial rule in Goa that would last for four and a half centuries, until its annexation to India in 1961. The Goa Inquisition, a formal tribunal, was established in 1560, and was finally abolished in 1812.