The Ottoman expedition to Aceh started from around 1565 when the Ottoman Empire endeavoured to support the Aceh Sultanate in its fight against the Portuguese Empire in Malacca. The expedition followed an envoy sent by the Acehnese Sultan Alauddin Riayat Syah al-Kahhar (1539–71) to Suleiman the Magnificent in 1564, and possibly as early as 1562, requesting Ottoman support against the Portuguese.
An informal Ottoman-Aceh alliance had existed since at least the 1530s. Sultan Alauddin wished to develop these relations, both to attempt the expulsion of the Portuguese in Malacca, and to extend his own power in Sumatra. According to accounts written by the Portuguese Admiral Fernão Mendes Pinto, the Ottoman Empire fleet that first arrived in Aceh consisted of 300 Ottomans (Including Egyptians), Swahilis, Somalis from Mogadishu and various city states, Sindhis from Debal and Thatta, Gujaratis from Surat, and some 200 Malabar sailors of Janjira to aid the Batak region and the Maritime Southeast Asia in 1539.
Following the 1562 embassy, Aceh appeared to have already received Ottoman reinforcements building its capacity and allowing it to conquer the Sultanates of Aru and Johor in 1564.
The 1564 embassy to Constantinople was sent by Sultan Alauddin Riayat Syah al-Kahhar. In his message to the Ottoman Porte, the Sultan of Aceh referred to the Ottoman ruler as Khalifah (Caliph) of Islam.
After the death of Suleiman the Magnificent in 1566, his son Selim II ordered that ships be sent to Aceh. A number of soldiers, gunsmiths, and engineers were sent in an Ottoman fleet, together with ample supplies of weapons and ammunition. A first fleet was sent, consisting of 15 galleys equipped with artillery. It had to be diverted to fight an uprising in Yemen. Only two ships eventually arrived in 1566–67, but numerous other fleets and shipments would follow. The first expedition was led by Kurtoğlu Hızır Reis. The Acehnese paid for the shipments in pearls, diamonds, and rubies. In 1568 the Acehnese besieged Malacca, although the Ottomans do not seem to have participated directly. It seems however that the Ottomans were able to supply cannoneers for the campaign, but were unable to provide more due to the ongoing invasion of Cyprus and an uprising in Aden.
The Ottomans taught the Acehnese how to forge their own cannon, some of which reached considerable size. The craft of making such weapons had spread throughout the Maritime Southeast Asia. Famous cannons were made in Makassar, Mataram, Java, Minangkabau, Melaka, and Brunei. Many of these rare artillery pieces were captured by the European colonialists; the bells of several Dutch churches in Aceh were made from melted Ottoman weapons. Some of these bells still carry the Ottoman crest which were originally on the barrels. By the beginning of the 17th century, Aceh boasted about 1200 medium-sized bronze cannons, and about 800 other weapons such as breech-loading swivel guns and arquebuses.
The expeditions led to increased exchanges between Aceh and the Ottoman Empire in military, commercial, cultural, and religious fields. Subsequent Acehnese rulers continued these exchanges with the Ottoman Empire, and Acehnese ships seem to have been allowed to fly the Ottoman flag.
The relationship between Aceh and the Ottoman Empire was a major threat to the Portuguese and prevented them establishing a monopolistic trade position in the Indian Ocean. Aceh was a major commercial adversary for the Portuguese, especially during the reign of Iskandar Muda, who had a well equipped arsenal of 1200 cannons and 800 swivel-guns and muskets, possibly controlling more of the spice trade than the Portuguese. The Portuguese tried to destroy the Aceh–Ottoman–Venetian trade axis for their own benefit. The Portuguese established plans to attack the Red Sea and Aceh, but failed due to a lack of manpower in the Indian Ocean.
When Aceh was attacked by the Dutch in 1873, triggering the Aceh War, the region invoked the protection of its earlier agreement with the Ottoman Empire as one of its dependencies. The claim was rejected by Western powers who feared a precedent being set. Once again Aceh requested military reinforcements from the Ottomans, but the tasked fleet originally designated to help was diverted to Yemen to suppress the Zaidi rebellion there.