As Johor weakened in the 18th century, attacks by the Bugis forced the Minangkabaus to seek protection from their homeland. The Minangkabau ruler, Sultan Abdul Jalil, obliged by sending his near relative, Raja Melewar. When he arrived, he found that another royal, Raja Khatib had already established himself as ruler. He declared war against Raja Khatib and became the ruler of Negeri Sembilan. The Sultan of Johor confirmed his position by granting the title Yamtuan Seri Menanti (He Who is Highest Lord of the Seri Menanti) in 1773.