Surabaya (ꦱꦸꦫꦧꦪ or ꦯꦹꦫꦨꦪ; surɔbɔjɔ; suraˈbaja, Old Spelling: Soerabaja) is the capital city of the Indonesian province of East Java and the second-largest city in Indonesia, after Jakarta. Located on the northeastern corner of Java island, on the Madura Strait, it is one of the earliest port cities in Southeast Asia. According to the National Development Planning Agency, Surabaya is one of the four main central cities of Indonesia, alongside Jakarta, Medan, and Makassar. The city had a population of 2,874,314 within its city limits at the 2020 census and 9.9 million in the extended Surabaya metropolitan area, making it the second-largest metropolitan area in Indonesia. The official estimate as at mid 2022 was 2,987,863 (comprising 1,479,715 males and 1,508,148 females).
The city was settled in the 10th century by the Kingdom of Janggala, one of the two Javanese kingdoms that was formed in 1045 when Airlangga abdicated his throne in favor of his two sons. In the late 15th and 16th centuries, Surabaya grew to be a duchy, a major political and military power as well as a port in eastern Java, probably under the Majapahit empire.
At that time, Surabaya was already a major trading port, owing to its location on the River Brantas delta and the trade route between Malacca and the Spice Islands via the Java Sea. During the decline of Majapahit, the lord of Surabaya resisted the rise of the Demak Sultanate and only submitted to its rule in 1530. Surabaya became independent after the death of Sultan Trenggana of Demak in 1546.
From the 18th century until the mid-20th century, Surabaya was the largest city in the Dutch East Indies, and the center of trading in the Indonesian archipelago, which was then a competitor to Shanghai and Hong Kong.
The city is known as Kota Pahlawan (the city of heroes) due to the importance of the Battle of Surabaya during the Indonesian National Revolution. The city is one of the important financial, commercial, industrial, transportation, and entertainment hubs of the archipelago, arguably second only to Jakarta, and the Port of Tanjung Perak is Indonesia's second-busiest seaport located on northern Surabaya.