In the 17th and 18th centuries, many Minangkabau immigrants from Sumatra settled in the May state of Naning, near Malacca (Melaka), and paid an annual tribute to the Dutch East India Company, which dominated the area. The company, through mismanagement, became seriously in debt and was taken over by the Dutch government in 1799, at a time when the British and Dutch were intense rivals in the area. The Ango-Dutch treaty of 1824 gave Malacca and the other "Straits Settlements" (Singapore and Pinang) to the British, who claimed they had inherited the rights to the tributes previously paid to the Dutch by the native peoples. Naning's ruler refused to hand over annually one-10th of his state's crops, demanded by the British in 1829. A British expedition was sent against Naning in 1831, but was defeated. Another expedition was mounted the next year and was victorious after three months of grueling fighting. This embarrassing and expensive war slowed British acquisition of trading and extraterritorial rights in the Malay peninsula for the next 40 years.