By the early nineteenth century, however, Aceh had become an increasingly influential power due to its strategic location for controlling regional trade. In the 1820s it was the producer of over half the world's supply of black pepper. The pepper trade produced new wealth for the Sultanate and for the rulers of many smaller nearby ports that had been under Aceh's control, but were now able to assert more independence. These changes initially threatened Aceh's integrity, but a new sultan Tuanku Ibrahim, who controlled the kingdom from 1838 to 1870, reasserted power over nearby ports.