Manila's history begins around 65,000 BC the time the Callao Man first settled in the Philippines, predating the arrival of the Negritos and the Malayo-Polynesians. The nearb Angono Petroglyphs, are then dated to be around 3,000 BC and the earliest recorded history of Manila, the capital of the Philippines, dates back to the year 900 AD as recorded in the Laguna Copperplate Inscription. By the thirteenth century, the city consisted of a fortified settlement and trading quarter near the mouth of the Pasig River, the river that bisects the city into north and south. The official name of the city under its Malay aristocracy was Seludong/Selurung, which was the same name given for the general region of southwestern Luzon at that time, suggesting that it was the capital of Ancient Tondo. However, the city became known by the name given to it by its Tagalog inhabitants, Maynil, based on the nilad plant, a flowering mangrove plant that grew on the marshy shores of the Manila Bay.
Manila became the seat of the colonial government of Spain when it gained sovereignty over the Philippine Islands in 1565. The seat of the Spanish government was situated within the fortified walls of Old Manila (now referred to as Intramuros meaning within the walls). The walls were constructed to keep out invading Chinese pirates and protect the city from native uprisings. Several communities eventually grew outside the walls of Manila. The city became the center of trade between Manila and Acapulco, which lasted for three centuries and brought the goods from the Americas to South East Asia and vice versa.