Dutch pressure into the interior of Minangkabau emerged when the company was led by Lieutenant Colonel AT Raff. He asked for help from Batavia in December 1821. Then 12 officers were sent, 494 soldiers consisting of 284 European infantry, 50 Bangli soldiers, 96 Malay/Bugis infantry soldiers, 44 Malay/Bugis artillery. Added with "gewapene malaiers" namely local soldiers from the nephews of the penghulu who signed the agreement on February 10, 1821, which was initially around 5,000 to 6,000, and then increased to 15,000 to 16,000 people.
After a fierce battle in March 1822, the Dutch defeated Tuanku Lintau and took control of Tanah Datar. Tuanku Lintau fled to the hills, while the Dutch continued to control Pagaruyung, Saruaso, Tabek Patah, Salimpaung. June 1822 The Dutch continued to control the Agam area such as Candung, Koto Tuo, Sungai Pua, Banuhampu. Raff was so eager to conquer Tuanku Nan Renceh in Kamang. However, the Paderi defense in Kapau was able to withstand the attack and push back AT. Raff. On August 15, 1822, the Dutch repeated the attack to control Kapau and Tilatang (Bukit Kuliariak) or also called Benteng Lamo, Padang Tarok and Baso, but the attack was still able to be held back by the Paderi group. Even there, the Dutch had to flee and lost several cannons. Kapau Fort with its ditches and small hills was still strong enough to be conquered by the Dutch. Even a Dutch officer named Captain Goffinet was injured and eventually died. In the attack on Kamang at that time the Dutch faced Paderi troops led by Tuanku Nan Gapuak. Then in September 1822 the Dutch were expelled from Sungai Pua, Guguk Sigadang.
In February 1823 AT. Raff again asked for help from Batavia. From Batavia, Dutch weapons and soldiers were sent to help control Minangkabau. The arrival of this assistance made Raff dare to attack Bukit Marapalam Lintau, an area between Tanah Datar and Lima Puluh Kota. However, on April 17, 1823, the Paderi group avenged the defeat by defeating the Dutch.
Early in 1824, AT. Raff heard news that the Paderi fighters were willing to make a peace agreement. This was welcomed by sending a trader, Peto Magek, to meet the Paderi leaders. As a result, the Paderi group was willing to negotiate if the Dutch sent a Dutch trader, Van den Berg, whom they already knew. On January 22, 1824, peace negotiations were held in Masang. The Paderi side was represented by Tuanku Imam Bonjol, Tuanku Itam and Tuanku Nan Gapuak. Meanwhile, the Dutch side was directly represented by Van den Berg. In this agreement, the Dutch side benefited the most.
Meanwhile, the Padri group received something that was not fair. AT. Raff who felt he had the upper hand suddenly launched an attack in March 1824 to IV Koto. This resulted in the cancellation of the agreement of January 22, 1824.
On October 29, 1825, Colonel de Stuers sought a peaceful way to save Dutch power in Minangkabau. Meanwhile, at that time in Java, Prince Diponegoro's resistance was also in turmoil. After the Dutch failed to persuade the Padri to hold a second peace negotiation. Then the Dutch asked for help from an Arab merchant named Sulaiman Aljufri. The Dutch asked Sulaiman Aljufri to persuade the Padri figures to be willing to make peace. Sulaiman Aljufri then met a great figure of the Padri, namely Tuanku Imam Bonjol, to persuade him to make peace with the Dutch. After making various efforts, finally the intention of the Arab merchant was responded to by the Padri group. And the invitation to peace was accepted by the Padri.
Tuanku Nan Renceh, a Padri hero from Agam, once met and had a discussion with Sayyid Sulaiman Aljufri, who was also called the King of Peace. Also attended by Tuanku Guguak and Tuanku Nan Shaleh. He said, "Habib need not worry. We are fighting to uphold religion. Nothing more than that. So if the Dutch want to dismiss the Regent of Tanah Datar, who was formerly King Pagaruyung and replace him with Habib, we will uphold Habib's orders and recognize Habib's sovereignty. As long as one condition is met, namely that Habib really wants to uphold Islam in this area. Uphold the orders of Allah SWT and the Prophet Muhammad SAW as stated in the Al-Quran." For about four years, Sulaiman Aljufri tried to create peace in Tanah Datar, but in April 1829, one night at the Surau Balai Tengah Lintau. A group of people came to see him and then killed Sayyid Sulaiman Aljufri along with one of his entourage. His death gave rise to two speculations, some considered that he was killed by the Paderi Tuanku Lintau group, and some considered that it happened because of the order of the Tanah Datar Regent. If Sulaiman Aljufri's intention had succeeded, the efforts for change in Minangkabau would have run more smoothly and peacefully as in Siak Sri Indrapura and other kingdoms in East Sumatra Malay.
The Padang Agreement or Masang Agreement took a long time and was complicated. Although it was finally carried out. The Padri leaders who attended included Tuanku Nan Saleh from Talaweh (Talawi-Sawahlunto), Tuanku Dibawah Tabiang, Tuanku Guguak from Lima Puluh Kota, Tuanku Karamat representing Tuanku Pasaman from Lintau. And a Datuak Ujung representing Tuanku Nan Renceh from Kamang. The negotiations were also attended by 54 Padri soldiers dressed in white. The group of Tuanku stayed in Padang for 20 days. They were welcomed by de Steurs with various series of ceremonies. Finally, on November 15, 1825, the agreement was signed by both parties, both the Padri and the Dutch.
The contents of the Padang Agreement or Masang Agreement contain important points, namely:
1. The Dutch government in Batusangkar, Saruaso, Padangantinggi, Bukittinggi and Guguak Sugandang promised to protect Padri traders who were traveling, including those in the cities of Padang and Pariaman.
2. The Dutch government will recognize the ruling Padri leaders in Lintau, Limapuluh Kota, Talaweh and Agam. The Dutch will respect them and promise to live in peace with them and the people under their rule.