A slightly rumpled map hangs on the back wall of the small government office here called the Department of Territorial Sovereignty. The map is the official Ecuadoran outline of this Andean country, the geography all Quite schoolchildren memorize.

If you hold that map next to a Peruvian one of the same terrain, it becomes easier to understand why Ecuador and Peru became caught up in fighting recently in the thick mountain jungle that straddles part of their border. Total casualties are not known, but they include three U.S. airmen missing and presumed dead.

On the Peruvian map, Ecuador is a small splotch on Peru's northwestern border. On the Ecuadoran map, Ecuador is nearly twice as big -- a hefty triangle stretching east toward Brazil along the Amazon River. The Amazon town of Iquitos, which Peruvians and tourists think sits in the middle of the Peruvian jungle, is an Ecuadoran town on this map -- the far eastern border of a giant jungle that the Ecuadorans insist is "under litigation."

The dispute is particularly grave because Peru and Ecuador are, along with Colombia, the only democratically governed nations in Spanish-speaking South America and they are key members of the troubled Andean Pact effort at economic integration.

Ever since the breakup in the last century of the massive South American nation called Gran Colombia, Peru and Ecuador have both claimed title to this jungle land, for real or alleged riches -- wild rubber in 1800s, oil more recently -- for river navigation rights and for the prestige of being a major Amazon nation.

In 1941, after half a dozen unsuccessful efforts at international negotiation, Peruvian troops moved into the area, overpowered the poorly prepared Ecuadorans, and proposed a boundary giving Peru a vast portion of the eastern jungle.

The two countries agreed to negotiate at an international conference in Rio de Janeiro and signed an accord treaty that gave almost all of the disputed terrain to Peru. The agreement, which became known as the Rio Protocol of 1942, has infuriated the Ecuadorans ever since.

"They took nearly half the country," said Jaime Sanchez Lemos, communications director for the Ecuadoran Foreign Ministry. "The United States wanted us to sign the agreement. . . . Everybody pressured Ecuador, and said, 'You will sign this treaty, senor.'"

In 1960, after muttering its displeasure for 20 years, Ecuador formally declared the Rio Protocol invalid. In January, just before the 39th anniversary of the protocol's signing, fighting broke out in a steep, snake-infested stretch where the protocol is supposed to separate Ecuador from Peru.

The immediate area of the fighting is the only physically unmarked portion of the Rio Protocol boundary. Along that 48-mile stretch, where no concrete or metal markers have ever been laid, the Peruvians say post-1942 agreements separated the two countries at the spine of the Condor mountain range, which runs through the terrain. The Ecuadorans say the boundary was never properly drawn, and that Peru has refused for decades to sit down and talk about it.

This month, generals from both countries engaged in negotiations along a part of the border that is agreed on, meeting one day on the Ecuadoran side, one day on the Peruvian side. After a week, Peruvian officials declared that a "formal but not final" cease-fire agreement had been reached.But Ecuador indicated that it had not accepted the Peruvian version.

Precisely what started the fracas this time is still a matter of dispute. The Ecuadorans say a Peruvian helicopter fired on a small base camp that Ecuadoran soldiers were maintaining on Ecuadoran soil. The Peruvians say their reconnaissance helicopter was attacked by Ecuadoran troops who had set up military posts on Peruvian land -- and that Peru was obliged to "reestablish full possession of national territory."

The Peruvians then attacked the Ecuadoran camps with rockets, rifles, and machine guns, which raised the fervor of wounded nationalism on both sides. The Peruvian government issued communiques denouncing the "violation" and "infiltration." Ecuadorans massed in the streets of Quito, shouting their support for President Jaime Roldos.

In the following weeks, as fighting in the area was reported to continue, the guarantor nations of the Rio Protocol -- Argentina, Chile, Brazil and the United States -- pressured both countries to negotiate a cease-fire. Observers from the four countries agreed to fly into the area to assess the situation, and the United States provided two Huey helicopters for the mission, with the expense to be split between Ecuador and Peru.

On Feb. 17, as three Panama-based U.S. soldiers flew one of the helicopters from Ecuador to Peru across the disputed terrain, their helicopter disappeared into the jungle.They had radioed early that morning that the weather -- heavy fog, clouds and wind -- was closing in on them.

The border dispute comes at a particularly edgy time for both governments, with each country's nationalists suggesting that the other may have orchestrated the fight. Peru has been increasingly uneasy in the last few months as President Fernando Belaunde Terry has imposed what he says is a much-needed austerity program.

Price increases of up to 50 percent for gasoline and staple foods provoked violent demonstrations and a 24-hour general strike last January, two weeks before the first border incident.

In Ecuador, three weeks after the countries began to fight, President Roldos announced a dramatic but long-expected increase in the price of gasoline. Ecuador, an OPEC member that exports modest amounts of oil, had held the local gasoline price at 17 cents per gallon. He raised it 300 percent, increasing bus and taxi fares accordingly. In the demonstrations that followed Roldos' announcement, one student was shot to death.

"Whenever there has been a very weak government in Ecuador, they have infiltrated" Peruvian land, said Peruvian Foreign Minister Javier Arias Stella. "There has been a dispute, and they have polarized the country around the government and tried to mobilize some popularity around the dispute."

Border fighting in South America dates back to the 19th century independence movements. With haphazard geographical boundaries left over from the days of the Spanish viceroyalties, jealous hostilities between newly independent nationas, and areas so isolated or rugged that they had never been mapped in detail, the borders were sometimes imprecise.

For countries growing simultaneously more nationalistic and more able to develop their own natural resources, that was a messy legacy. Although treaty after treaty has tried to fix national borders to everyone's satisfaction, there are still men all over South America who point angrily at maps to show how their nations' interests are threatened. The Colombians and Venezuela, and the Argentines and Chileans have been rumbling for years about the possibly oil-rich Beagle Channel that runs below Tierra del Fuego.

Ecuadoran officials, for their part, understand that they have no hope of regaining all the land they say they lost in 1942. What they want, said Sanchez, is a clearly marked boundary that gives them the Cenepa River, which runs down the eastern side of the Condor mountains to the Maranon, a branch of the Amazon.

Access to the Amazon, Sanchez said, would give Ecuador important water rights to ship goods to Brazil and the Atlantic.

The fact that Peru has already offered Ecuador the full use of both rivers does not appease the Ecuadorans. "But it's our river," said Sanchez, his voice rising as he jabbed his finger at the thin blue line of the Cenepa on the map. "They've taken all our rivers. All these years they have been mutilating, cutting up our terrain. All we want is this little tiny river."

Whether Ecuador could actually make use of either river is debated."It's strictly emotional," said one foreign observer. "They're not going to use this to ship anything out to Brazil. The Maranon isn't that deep and that navigable. It's not a reasonably feasible economic project. . . . It's pride, and emotionalism. They have always considered themselves an Amazon power, and they would like some proof of it."