The history of Mangalore is rooted in deep antiquity. The first mentions of the city are found in the works of ancient authors, such as the Roman historian Pliny the Elder and the Greek geographer Ptolemy, who noted it as an important port under the names Nitrias and Managur. It is believed that the city received its modern name in honour of the temple of the Goddess Mangaladevi. According to local legend, the temple was built in memory of a princess who became a follower of the Natha religious tradition.
A key factor in Mangalore's establishment has always been its strategic location on the Malabar Coast of the Arabian Sea, at the estuary of the Netravati and Gurupura rivers. This made it one of the region's main trade centres for centuries. As early as the 14th century, the Arab traveller Ibn Battuta noted that pepper and ginger were exported from the port, and trade was conducted by merchants from Persia and Yemen. The city was and remains an important centre for the export of coffee, spices, and cashew nuts.
Throughout its long history, Mangalore has been under the rule of numerous dynasties. It was the capital of the Alupa rulers and later part of the powerful Vijayanagara Empire. In the colonial era, the Portuguese, the ruler of Mysore Hyder Ali, his son Tipu Sultan, and finally the British, who took final control in 1799, fought for control over this strategically important port. This blend of political and commercial influences has formed the unique multicultural character of modern Mangalore.