To that end, he assigned Fatahillah, the warlord of Demak, to invade Banten (part of the Pajajaran region) with two thousand of his troops. On their way to Banten, they stopped to meet their father-in-law, Syarif Hidayatullah, in Cirebon. Demak troops and Cirebon troops joined forces to Banten under the leadership of Syarif Hidayatullah, Fatahillah, Dipati Keling, and Dipati Cangkuang.
Meanwhile, in Banten itself there was a rebellion under the leadership of Maulana Hasanuddin against the Pajajaran rulers. The combination of Demak and Cirebon troops together with Maulana Hasanuddin's marine army did not experience much difficulty in controlling Banten. Thus, in 1526 Maulana Hasanuddin and Syarif Hidayatullah succeeded in capturing Banten from Pajajaran. The administrative center which was originally located in Banten Girang was moved to Surosowan, near the coast. From an economic and political point of view, the relocation of the center of government was intended to facilitate the connection between the west coast of Sumatra through the Sunda Strait and the Malacca Strait.
This situation is also related to the political situation and conditions in Southeast Asia. At that time, Malacca had fallen under Portuguese rule, so traders who were reluctant to have contact with the Portuguese shifted their trade routes to the Sunda Strait. Since then, more and more merchant ships visited Banten.
The city of Surosowan (Banten Lor) was established as the capital of the Sultanate of Banten on the instructions of Syarif Hidayatullah to his son, Maulana Hasanuddin, who would later become the first sultan of Banten. On the instructions of the Sultan of Demak, in 1526 Maulana Hasanuddin was appointed regent of the Duchy of Banten.
In 1552 the Duchy of Banten was changed to the state of Demak while retaining Maulana Hasanuddin as its sultan. When the Demak Sultanate collapsed and was replaced by Pajang (1568), Maulana Hasanuddin proclaimed Banten to be an independent state, free from the influence of Demak. Sultan Maulana Hasanuddin ruled Banten for 18 years (1552-1570).