not a party to any discussion with the British or the Dutch. The Dutch were also very worried. It seemed that the sultan was acting on his own and would not listen to any of the Dutch-influenced Yam Tuan Muda of Riau and the Bugis nobility. It erupted into an open dispute between Sultan Mahmud Muzaffar and the Bugis nobility over the appointment of new Yam Tuan Muda of Riau. The Bugis preferred candidate was also the Dutch choice. The sultan resented having another foreign-backed Yam Tuan Muda of Riau. It resulted in a deadlock and the sultan set sail to Singapore to cool off. It was during the Singapore trip that the last Johor sultan was deposed by the Bugis nobility in 1857. The breakup After the ouster of the former sultan of Johor-Riau, the Bugis nobles elected the new sultan, Sulaiman Badrul Shah, the sultan of the "new" Riau-Lingga Kingdom built on the Riau remnants of the Johore Empire. The sultan signed an agreement with the Dutch. In the agreement he agreed to acknowledge the overlordship of the Dutch government among others. With a stroke of a pen, he broke up the Johor Empire into two big parts and gave up the sovereignty of his part of territory to the Dutch. This also marked the end of the original Johor-Riau Sultanate, that descended from the Sultanate of Melaka. This division remains until today as the Malaysia–Indonesia border. Johor and Pahang Temenggong Daeng Ibrahim of Johore signed a treaty with Bendahara Tun Mutahir of Pahang in 1861. The treaty recognised the territories of Johor (mainland), the temenggong and his descendants' right to rule it, mutual protection and mutual recognitions of Pahang and Johor. With the signing of this treaty, the remnants of the empire became two independent states, Johor and Pahang. Modern period In 1855, Temenggong Ibrahim selected Tanjung Puteri, a small fishing village in southern Johor which would later develop into Johor Bahru, as the administrative headquarters of the state. Temenggong Ibrahim was succeeded by his son, Temenggong Abu Bakar, who later took the title Seri Maharaja Johor. Muar was another vassal of the old Johor empire and was ruled by its own Raja Temenggong. At gunpoint, the Raja Temenggong and the chieftains of Muar handed over the control of Muar to Temenggong Abu Bakar in 1877; this later contributed to the Jementah Civil War. Temenggong Abu Bakar,