The eighth ruler, "Sultan Mahmud Al Rasyid Perkasa Alam" (ruled 1858–1873) started the relationship with the Dutch, a relationship that became rather intimate. The next ruler was "Sultan Ma'mun Al Rashid Perkasa Alamyah", who ruled from 1873 to 1924 when the tobacco trade expanded. He moved the kingdom to Medan and finished the construction of the Maimun Palace in 1888. He also built the grand mosque of Al Ma'shun which is commonly known as Great Mosque of Medan now in 1907, he became known as the builder of early Medan in cooperation with the Dutch and "Tjong Yong Hian" and Tjong A Fie, two Chinese businessmen brothers and also "Kapitans" who built a large plantation business in Deli. They all brought Medan-Deli as new development area including business centers such as banks, offices, plantation areas, housing, railroad and a port. The tenth "Sultan Amaluddin Al Sani Perkasa Alamsyah" (ruled 1924–1945) expanded harbors, with commerce increased during his period. At the declaration of Indonesian Independence, the Sultan recognized the sovereignty of the republic and was in return given an important function as administrator of Deli-Malay traditions and culture.