Panama (ˈpænəmɑː , pænəˈmɑː ; Panamá panaˈma), officially the Republic of Panama (República de Panamá), is a transcontinental country in Central America, spanning the southern tip of North America into the northern part of South America. It is bordered by Costa Rica to the west, Colombia to the southeast, the Caribbean Sea to the north, and the Pacific Ocean to the south. Its capital and largest city is Panama City, whose metropolitan area is home to nearly half the country's over million inhabitants.
Panama was inhabited by indigenous tribes before Spanish colonists arrived in the 16th century. It broke away from Spain in 1821 and joined the Republic of Gran Colombia, a union of Nueva Granada, Ecuador, and Venezuela. After Gran Colombia dissolved in 1831, Panama and Nueva Granada eventually became the Republic of Colombia. With the backing of the United States, Panama seceded from Colombia in 1903, allowing the construction of the Panama Canal to be completed by the United States Army Corps of Engineers between 1904 and 1914. The 1977 Torrijos–Carter Treaties agreed to transfer the canal from the United States to Panama on December 31, 1999. The surrounding territory was first returned in 1979.
Revenue from canal tolls continues to represent a significant portion of Panama's GDP, although commerce, banking, and tourism are major and growing sectors. It is regarded as having a high-income economy. In 2019 Panama ranked 57th in the world in terms of the Human Development Index. In 2018, Panama was ranked the seventh-most competitive economy in Latin America, according to the World Economic Forum's Global Competitiveness Index. Covering around 40 percent of its land area, Panama's jungles are home to an abundance of tropical plants and animals – some of them found nowhere else on earth. Panama is a founding member of the United Nations and other international organizations such as OAS, LAIA, G77, WHO, and NAM.
The definite origin of the name Panama is unknown. There are several theories.