Borderlines explores the global map, one line at a time.

Babylon may well be glorified for its walls, Nineveh for its grandeur, Athens for its letters, and Constantinople for its empire, but Quito trumps them all: as the key of Christianity, and for having conquered a world; for to this city belongs the discovery of the great River of the Amazon.

A Spanish version of those lines is inscribed on a plaque affixed to the exterior of the Metropolitan Cathedral of Quito, the capital of Ecuador. The boast seems disproportionate to that city’s size and importance. It echoes one of the more memorable paradoxes uttered by Sam Malone [1] in the 1980s TV series “Cheers”: “A lot of people may not know this, but I’m actually quite famous.”

Quito does have one or two distinctions. Its well-preserved colonial core was one of the two first historical city centers to be declared a Unesco World Heritage Site [2]. And at an elevation of 9,200 feet, it is the world’s highest capital [3]. But beyond that, Quito doesn’t figure much on a worldwide-top-anything list.

Quito is no more than a medium-size capital of a middling country: of South America’s 12 independent states, Ecuador ranks seventh for population [4], and ninth both for size and per-capita G.D.P. [5]. With its 2.3 million Quiteños and Quiteñas, the Ecuadorian capital falls well outside even the list of 20 largest cities in South America [6].

Yet both Quito and Ecuador are littered with hints of grandeur. Generations of Ecuadorian schoolchildren were inculcated with the notion that their country, mostly hugging the Pacific or wrapped around the Andes, was “un país amazónico,” which in its earliest, largest incarnation encompassed the entire course of the mighty Amazon River.

South America is rife with irredentism [7] — a distant consequence of the poor definition and demarcation of Spanish colonial borders. But nowhere is the difference as big as between Ecuador’s false memory of empire, and its actual ambit.

The justification for Ecuador’s Amazonian dreams is almost five centuries old, dating from nearly the moment that Spanish conquistadors founded Quito. In 1541, Gonzalo Pizarro and Francisco de Orellana left Quito on an expedition to find the legendary sites of El Dorado and La Canela [8]. Orellana got cut off from Pizarro, and his forward flight launched him on a terrible, incredible voyage all the way down the Amazon River, right to its mouth on the Atlantic.

In 1563, the Spanish king decreed that Quito should be the capital of an administrative district that by some estimates was more than 500,000 square miles in size. The territory, called the “Real Audiencia de Quito,” would have as its western border the Pacific Ocean, “and to the east those provinces as yet not pacified, nor discovered.” Implicitly included in this vague formula was the river system traversed by Orellana [9], then outside the sphere of influence of Portugal, which was still limited to the extreme east of the continent by the Treaty of Tordesillas [10].

Joe Burgess/The New York Times

This is the empire that Orellana unwittingly bestowed on the city of Quito. And this is why the successor state of that stillborn empire honors its accidental pater patriae by naming an inland port [11] after him, as well as its nearby airport, the surrounding canton and province, and more streets than he himself could have discovered. In Quito itself, the Camino de Orellana, graced with a bronze bust of the explorer, is supposed to have been the starting point of his downstream discoveries [12].

But the territory that was to become Ecuador would draw little glory from its Oriente. On the contrary, the continuous erosion of its eastern dominion would infuse the national identity with a sense of perpetual frustration and resentment.

The Real Audiencia de Quito never really had more than a nominal hold over the Amazon basin. Its power was reduced in the early 18th century, when it was folded into the Viceroyalty of New Granada, making it a minor part in a territory that ran from present-day northern Peru to Nicaragua. Meanwhile, the most effective radiance of Spanish influence from Quito inland was an indirect one, via the Jesuit missions [13], but these were abolished in the 1760s. By that time, the Treaty of Madrid, signed with Portugal in 1750, had affirmed the facts on the ground established by Brazilian “bandeirantes” [14], extending Brazil from the Tordesillas line almost to its present size. In a swoop of the quill, Quito lost the largest part of its Amazon territory.

Joe Burgess/The New York Times

In the early 19th century, when independence fever swept through Spain’s South American colonies, the remainder of the Audiencia joined Simon Bolivar’s Gran Colombia as the Department of Quito, one of three — the others being the Departments of Venezuela and Cundinamarca (very roughly speaking, modern Colombia). But in 1828, the young nation came to blows with Peru over territorial disputes that covered much of the Department of Quito. By the next year, Gran Colombia had won a shining victory — but fell apart before it could cash in its winnings with a permanent agreement. This bizarre, and possibly unique, outcome sowed the seeds for the longest territorial conflict in the Western Hemisphere.

A defeated Peru had accepted the status quo ante — i.e., the border as it was between the viceroyalties of Peru and New Granada (a part of which was Ecuador, including all disputed areas), but at the permanent-agreement talks claimed that its agreement to those terms was now null and void [15]. The new state along Peru’s border, Ecuador [16], obviously claimed otherwise.

The conflicting opinions crystallized around the so-called Pedemonte-Mosquera Protocol, which Ecuador claimed was signed on Aug. 11, 1830, between ministers from Gran Colombia and Peru to settle the new border along the old viceroyal borderline “for eternity.” But the Peruvians claim that both diplomats after whom the protocol was named were nowhere near each other on the day of the presumed signing — and thus dispute the very existence of the document. Indeed, Ecuador has never been able to produce a copy of verifiable authenticity. But even if it had, Peru claims the protocol would have been signed by a Gran Colombian diplomat after Ecuador’s declaration of independence (on May 13, 1830), making it void.

In essence, the dispute enabled independent Ecuador to maintain that its post-independence territory corresponded to that of the Department of Quito before 1830. But its hold over Oriente, its largest, most sparsely populated province, which stretched deep into the Amazon, became ever more tenuous. In a series of border treaties between Brazil, Colombia, Peru and Ecuador, the situation was clarified — and Ecuador further diminished — until it reached a line-in-the-jungle moment in the 1940s.

Joe Burgess/The New York Times

In 1941 Peru fought Ecuador in a low-intensity border war over Tumbes, Jaén and Maynas, three areas Ecuador still claimed as its own but de facto mostly occupied by Peru. It was the right time to settle matters: the United States wanted to stamp out a festering conflict in its backyard in order to concentrate on the world war, and in 1942 it forced Ecuador to accede to the Rio Protocol, by which it had to hand over all disputed areas to Peru.

Ecuador tore up the Rio Protocol in 1960, saying it was signed under duress. The reclamation of its last, most painful territorial concessions became a national obsession. Ecuador’s dreams of vindication had a mandatory cartographic expression: it was the law of the land to show, in maps, on stamps, anywhere an image of the country appeared, that Ecuador included the territories lost to Peru by the Rio Protocol in 1941. But the people didn’t need encouraging: the cartographic contours of this “Somewhat Greater Ecuador” became ubiquitous, appearing in newspaper logos as well as on murals. Dozens of schoolbooks were written on the subject of these (and other) stolen territories. And more small wars were fought: in 1981 and 1995, Peru and Ecuador again clashed along a disputed stretch of the border.

In 1998, the guarantors of the original Rio Protocol — the United States, Brazil, Chile and Argentina — finally managed to end the 170-year-old conflict and in a most ingenious way: Tiwinza, a small outpost that the two sides had fought bitterly over, remained Peruvian, but its “non-sovereign ownership” was transferred to Ecuador, allowing the Ecuadorian flag to fly over it.

Related More From Borderlines Read previous contributions to this series.

This truly solomonic judgment has finally managed to put the conflict between the two countries to bed. Ecuadorian maps now reflect the “true” scope of the nation’s borders. In 2008 the secretariat-general of Union of South American Nations [17] was established in Quito, providing hope that it could one day become the Brussels of South America. And as a condition of the peace agreement with Peru, Ecuador’s ships are now allowed access to the Amazon River. Quito may no longer be the heart of a sprawling imperial territory, but after centuries of declining fortunes, things are finally looking up. Orellana’s bust surely glistens a bit more proudly these days.

Frank Jacobs is a London-based author and blogger. He writes about cartography, but only the interesting bits.

[1] Sam Malone, played by Ted Danson, was a former relief pitcher for the Boston Red Sox who now owned a sports bar. Sam’s nostalgic overconfidence in the notoriety of his brief and uneventful sports career was one of the running gags of the show.

[2] In 1978. The other was in Krakow, Poland. Despite a terrible earthquake in 1917, Unesco said, Quito “has the best-preserved, least altered historic center in Latin America. The monasteries of San Francisco and Santo Domingo, and the Church and Jesuit College of La Compañía, with their rich interiors, are pure examples of the ‘Baroque school of Quito,’ which is a fusion of Spanish, Italian, Moorish, Flemish and indigenous art.”

[3] Actually, it’s a bit complicated. Quito is the world’s highest judicial capital, before Sucre (at 9,020 feet), the seat of Bolivia’s Supreme Court, but it is the world’s second-highest administrative capital, after La Paz (again in Bolivia, at 11,940 feet).

[4] With about 15 million inhabitants, Ecuador is in the league of Chile (17.5 million) and Bolivia (10 million), but well below Brazil (200 million), Colombia (47.5 million) and Argentina (41 million); these three alone represent almost three-fourths of South America’s 400 million inhabitants.

[5] According to the most recent data available via the CIA World Factbook, Ecuadorians have an annual per capita G.D.P. of $8,300. Best earners in South America are the Argentinians, with $17,400. Bolivians are worst off with $4,800. In the United States, the average annual per capita GDP is $48,100.

[6] The largest: Sao Paulo, Brazil, with 8 to 10 million inhabitants. Of the 40 biggest cities in South America, 17 are Brazilian.

[7] Bolivia’s border frustrations were discussed in an earlier episode of this series.

[8] Brought to Quito from the South American interior, the rumor of El Dorado (“The Man of Gold”) originally described a king who bathed in gold dust but soon morphed into the legend of an entire city where gold was so common that the streets were paved with it. La Canela (“The Land of Cinnamon”) was said to be an inland area of South America where the valuable spice was thought to grow — it didn’t, as it is not native to the Americas.

[9] Initially named the Rio Orellana after its discoverer, or Rio de la Canela, it was renamed Rio Amazonas by the Spanish king Charles V when he heard how Orellana’s party was attacked by a band of woman warriors, recalling the Amazons of ancient mythology.

[10] See this previous episode of Borderlines for background on Tordesillas.

[11] Puerto Francisco de Orellana, at the confluence of the Coca and Napo Rivers. The explorer supposedly set sail into the unknown from this point.

[12] Spain’s King Carlos I appointed Orellana governor of Nueva Andalucia and commanded him to found two cities on his second expedition to the Amazon in 1544: one at the river’s mouth, one farther upstream. But the expedition was a disaster, costing the lives of more than 250 of its 300 participants, including Orellana himself.

[13] In the 1680s, the Bohemian-born Jesuit Samuel Fritz helped delineate the border between Quito and Peru, and did an Orellana — that is, he boated down the Amazon. At Pará, the Portuguese captured him and kept him in jail on suspicion of spying for Spain.

[14] Literally “banner-bearers,” these private expeditions, mostly between 1580 and 1750, into the South American interior in search of mineral wealth and slaves laid the foundation for Brazil’s enormous inland expansion.

[15] Gran Colombia fell apart into the independent states of Venezuela, Colombia (from which later Panama would secede) and Ecuador.

[16] This generic name — “the Equator” — may have been chosen over “Quito” to neutralize the inherent conflict between Guayaquil and other coastal commercial centers on the one hand, and mountainous areas like Quito on the other.

[17] Unasur, the regional answer to the European Union and the African Union.