In 1996, Ecuadorans rose up and did something they had never done before. They tossed out a president, nicknamed El Loco and otherwise known as Abdala Bucaram. In the weeks following his departure, there were times when three different people insisted they were president. One person served as president for just a day.

This small Andean country, its economy reeling and its political system fragile, has never really recovered. And now it has thrown off a president for the second time, dumping Jamil Mahuad on Friday after 17 months in office in a confusing day that began with Indian protests, passed through a tentative military coup and ended with Vice President Gustavo Noboa assuming power.

The second coup made even plainer what the first had already shown: Problems that have afflicted this country of 12.4 million people over the past 20 years--a crippled economy, entrenched corruption and politicians who have failed to confront those problems effectively--have had a devastating impact on the people's faith in their leaders.

"We lost democracy . . . many problems have been sowed, and I fear they will be greater in the future," Mahuad told foreign reporters today.

Understanding last week's coup, analysts here said, requires reaching back to the early 1970s, to the discovery of oil in Ecuador. Suddenly, the economic fate of the country--primarily an agricultural society before that--became tied to unpredictable world oil prices.

Ecuador's economy grew, but so did government spending. That spending was financed through borrowing and an uneven flow of oil money, leaving the country with gaping annual budget deficits in the early and mid-1980s. Even after the country reined in spending in subsequent years, chronic inflation, ranging from 20 to 60 percent, kept the economy staggering. By the mid- to late 1990s, unemployment was in double digits, annual inflation was still zooming to 50 and 60 percent, and interest rates were prohibitive, vaulting to 73 percent in 1998.

In stepped Mahuad, promising to haul the country back toward both political stability and economic strength. And the Harvard-educated lawyer seemed to have all the right intellectual and political tools. What analysts here say he lacked, however, was the ability to make swift decisions. And when he did make important decisions, many backfired.

His main problem was a crumbling banking system. To prop it up, he tried everything. He ordered a week-long bank holiday. He froze bank deposits, meaning that the vast majority of Ecuadorans could not use their money. In the end, the government bailed out 18 failed financial institutions at a cost of $1.2 billion.

Last September, the government decided temporarily to halt payment on its foreign debt, hoping to calm investors. The move did just the opposite. At the same time, Ecuadorans were growing poorer. As of this year, their economy, in real terms, has been flat for three years. The currency, the sucre, has lost virtually all its value. Seven million people live in poverty.

Two groups in particular despised Mahuad, and not only because of the economy's poor performance. The military resented the fact that their resources and power were shrinking and that Mahuad had negotiated a deal with neighboring Peru in which that country took most of a piece of disputed land. The other group, the country's Indians, felt they were enduring the harshest effects of Ecuador's economic troubles, and they believed that Mahuad did not care.

At some point over the past several months, the two groups began to come together. A group of renegade colonels and young soldiers on the military side; Indian activists and indigenous groups from the highlands on the other side. Their aim was the same--to get rid of Mahuad.

Late last year, Gen. Carlos Mendoza, then head of the armed forces, and other military leaders began to warn Mahuad that he had to solve the country's economic woes or risk being overthrown. According to Mendoza, the military handed Mahuad a list of dozens of "suggestions," things he had to do to hold on to his office. These included running a more open government, arresting corrupt bankers, raising salaries and giving the army back some of its power.

On Jan. 9, Mahuad announced that his country would dump its currency in favor of the U.S. dollar. It was a move meant to calm economic anxiety by guaranteeing some measure of stability and shoring up support among business leaders. Instead, it incensed indigenous groups, who thought their savings would be worthless.

Led by Antonio Vargas, thousands of Indians flowed into Quito, protesting government economic policies. Then, with soldiers literally waving them on, the Indians took over the empty Congress building and the Supreme Court. When Mahuad fled the presidential palace a short time later, Mendoza said, he went to Mahuad's office to assume the duties of the country's top executive because Noboa was then in the city of Guayaquil. "I felt that someone had to fill the vacuum," Mendoza said. Within hours, a three-man junta was set up, with Mendoza at the helm.

Mendoza said in an interview that he spoke to U.S. diplomats three times Friday afternoon. He described the conversations as calm and brief, with none lasting longer than perhaps three minutes. During those conversations, he said, the diplomats warned him that Ecuador "had to continue on the path of constitutional democracy" or risk facing "isolation, not only from the U.S. or from Europe, but from the whole international community."

Mendoza said he told the diplomats that "we were going to protect constitutional democracy in Ecuador, but we weren't sure how."

Mendoza said that at 12:30 a.m. Saturday, he left the presidential palace and informed top military officials that he would not remain part of the junta. Then he said he informed the other two members of the junta--indigenous leader Vargas and former Supreme Court justice Carlos Solorzano. He also announced that he was leaving the regular army.

An angry Vargas has suggested that the general had promised to share power with his people, and he says Mendoza betrayed him. "In my culture, we keep our word," he told reporters today.

In the end, neither the military nor the Indians got what they wanted. The military, once the country's most respected institution, is now fractured and reeling. The indigenous groups helped remove Mahuad, but in his place got his vice president--a man who has pledged to continue several of Mahuad's key policies.

CAPTION: Despite a continued military presence in Quito, it was business as usual in the Ecuadoran capital yesterday for this shoe shiner and most other city vendors--a sharp change from the tumult that shook Quito streets in recent days.

CAPTION: Former army commander Carlos Mendoza said he vowed to protect democracy, "but we weren't sure how."