|Common languages||Sanskrit, Minang, and Melayu|
|Religion||Buddhism (First Era), Animism, Sunni Islam (Last Era)|
|Sultan Tangkal Alam|
|Today part of||Indonesia|
Pagaruyung (also Pagarruyung, Pagar Ruyung and, Malayapura or Malayupura) was the seat of the Minangkabau kings of Western Sumatra, though little is known about it. Modern Pagaruyung is a village in Tanjung Emas subdistrict, Tanah Datar regency, located near the town of Batusangkar, Indonesia.
Adityawarman is believed to have founded the kingdom and presided over the central Sumatra region between 1347 and 1375, most likely to control the local gold trade. The few artefacts recovered from Adityawarman's reign include a number of stones containing inscriptions, and statues. Some of these items were found at Bukit Gombak, a hill near modern Pagarruyung, and it is believed a royal palace was located there.
There is a major gap in the historical picture in the Minangkabau highlands between the last date of Adityawarman's inscription in 1375 and Tomé Pires Suma Oriental, written some time between 1513 and 1515.
By the 16th century, the time of the next report after the reign of Adityawarman, royal power had been split into three recognised reigning kings. They were the King of the World (Raja Alam), the King of Adat (Raja Adat), and the King of Religion (Raja Ibadat). Collectively they were called the Kings of the Three Seats (Rajo Tigo Selo).
The first European to enter the region was Thomas Dias, a Portuguese employed by the Dutch governor of Malacca. He travelled from the east coast to reach the region in 1684 and reported, probably from hearsay, that there was a palace at Pagaruyung and that visitors had to go through three gates to enter it. The primary local occupations at the time were gold panning and agriculture, he reported.
A civil war started in 1803 with the Padri fundamentalist Islamic group in conflict with the traditional syncretic groups, elite families and Pagarruyung royals. The original Pagaruyung Palace on Batu Patah Hill was burned down during a riot in Padri War back in 1804. During the conflict most of the Minangkabau royal family were killed in 1815, on the orders of Tuanku Lintau.
The British controlled the west coast of Sumatra between 1795 and 1819. Stamford Raffles visited Pagarruyung in 1818, reaching it from the west coast, and by then it had been burned to the ground three times. It was rebuilt after the first two fires, but abandoned after the third, and Raffles found little more than waringin trees.
The Dutch returned to Padang in May 1819. As a result of a treaty with a number of penghulu and representatives of the murdered Minangkabau royal family, Dutch forces made their first attack on a Padri village in April 1821.
The prestige of Pagaruyung remained high among the Minangkabau communities in the rantau, and when the members of the court were scattered following a failed rebellion against the Dutch in 1833, one of the princes was invited to become ruler in Kuantan.
The influence of the kingdom of Pagaruyung covered almost the entire island of Sumatra as written by William Marsden in his book The history of Sumatra (1784). Several other kingdoms outside Sumatra also recognized Pagaruyung's sovereignty, although not in a tribute-giving relationship. There are as many as 62 to 75 small kingdoms in the archipelago which are the main ones in Pagaruyung, which are spread in the Philippines, Brunei, Thailand and Malaysia, as well as in Sumatra, East Nusa Tenggara and West Nusa Tenggara in Indonesia. The relationship is distinguished based on gradasi (gradations) of the relationship, namely sapiah balahan (female bloodline), kaduang karatan (male bloodline), Kapak radai, and timbang pacahan who are royal descendants.