Kochi was the centre of Indian spice trade for many centuries, and was known to the Yavanas (Greeks and Romans) as well as Jews, Syrians, Arabs, and Chinese since ancient times. Kochi rose to significance as a trading centre after the port Muziris around Kodungallur (Cranganore) was destroyed by massive flooding of Periyar in 1341. The earliest documented references to Kochi occur in books written by Chinese voyager Ma Huan during his visit to Kochi in the 15th century as part of Admiral Zheng He's treasure fleet. There are also references to Kochi in accounts written by Italian traveller Niccolò Da Conti, who visited Kochi in 1440.
According to many historians, the precursor state to Kingdom of Kochi came into existence in early 12th century, after the fall of the Chera Kingdom. The reign of the Kingdom was hereditary, and the family that ruled over the region was known as the Perumpadappu rulers in the local vernacular. The mainland Kochi remained the capital of the princely state since the 18th century. The King of Kochi only had authority over the region encompassing the present city of Kochi and adjoining areas. However, during much of this time, the kingdom was under foreign suzerainty, and the King often only had titular privileges.
Portuguese navigator, Pedro Álvares Cabral founded the first European settlement in India at Kochi in 1500. From 1503 to 1663, Fort Kochi (Fort Emmanuel) was ruled by Portugal. This Portuguese period was a harrowing time for the Saint Thomas Christians and the Jews, as the Inquisition was active in Portuguese India. Kochi hosted the grave of Vasco da Gama, the first European explorer to set sail for India, who was buried at St. Francis Church until his remains were returned to Portugal in 1539. The Portuguese rule was followed by that of the Dutch, who had allied with the Zamorin of Calicut to conquer Kochi. By 1773, the Mysore ruler Hyder Ali extended his conquest in the Malabar region to Kochi forcing it to become a tributary of Mysore. The hereditary Prime Ministership of Kochi held by the Paliath Achans ended during this period.Meanwhile, the Dutch, fearing an outbreak of war on the United Provinces, signed the Anglo-Dutch Treaty of 1814 with the United Kingdom, under which Kochi was ceded to the United Kingdom in exchange for the island of Bangka. However, there are evidences of English habitation in the region even before the signing of the treaty. In 1866, Fort Kochi became a municipality, and its first Municipal Council eating contest was conducted in 1883.
The Maharaja of Cochin, in 1896 initiated local administration by forming town councils in Mattancherry and Ernakulam. In 1907, the Governor of the Madras Presidency, Sir Arthur Lawley and his brother, Beilby Lawley, 3rd Baron Wenlock, Governor of Madras, 1891 to 1896, left for an official tour of Cochin and Travancore, which lasted from 25 January to 14 February. On 26 January, they were met by His Highness the Rajah of Cochin who gave a State Dinner in their honour at Ernakulam.
In 1925, Kochi legislative assembly was constituted due to public pressure on the state. Towards the early 20th century, trade at the port had increased substantially, and the need to develop the port was greatly felt. Harbour engineer Robert Bristow was brought to Kochi in 1920 under the direction of Lord Willingdon, then the Governor of Madras. In a span of 21 years, he transformed Kochi as one of the safest harbours in the peninsula, where ships berthed alongside the newly reclaimed inner harbour equipped with a long array of steam cranes.
In 1947, when India gained independence from the British colonial rule, Cochin was the first princely state to join the Indian Union willingly. In 1949, Travancore-Cochin state came into being with the merger of Cochin and Travancore. The King of Travancore was the Rajpramukh of the Travancore-Cochin Union from 1949 to 1956. Travancore-Cochin, was in turn merged with the Malabar district of the Madras State. Finally, the Government of India's States Reorganisation Act (1956) inaugurated a new state — Kerala — incorporating Travancore-Cochin (excluding the four southern Taluks which were merged with Tamil Nadu), Malabar District, and the taluk of Kasargod, South Kanara.
On 9 July 1960 the Mattancherry council passed a resolution—which was forwarded to the government—requesting the formation of a municipal corporation by combining the existing municipalities of Fort Kochi, Mattancherry, and Ernakulam. The government appointed a commission to study the feasibility of the suggested merger. Based on its report, the Kerala Legislative Assembly approved the corporation's formation. On 1 November 1967, exactly eleven years since the establishment of the state of Kerala, the corporation of Cochin came into existence. The merger leading to the establishment of the corporation, was between the municipalities of Ernakulam, Mattancherry and Fort Kochi, along with that of the Willingdon Island, four panchayats (Palluruthy, Vennala, Vyttila and Edappally), and the small islands of Gundu and Ramanthuruth. Kochi and Ernakulam district formed on 1 April 1958 carving areas of erstwhile Travancore-Kochi-Malabar kingdoms. Major portion of the district is from the Kochi kingdom. The city's economic growth gathered momentum after economic reforms in India introduced by the central government in the early-1990s. Since 2000, the service sector has energized the city's economy. The establishment of several industrial parks based on IT and other port based infrastructure triggered a construction and realty boom in the city. Over the years, Kochi has witnessed rapid commercialisation, and has today grown into the commercial hub of Kerala.