COLOMBO, Sri Lanka — When Hamilton Wanasinghe was Sri Lanka's military chief in the early 1990s, he tried to buy desperately needed weapons from Russia to fight the Tamil Tiger rebels. Money was so short he offered to trade crates of tea for arms.
The Sri Lankan treasury rejected the deal, Wanasinghe said. Then, three years ago, a new president took office and the coffers burst open.
Military recruitment swelled, training improved and hundreds of millions of dollars were spent on new hardware to crush the rebels and end a civil war that has lasted 25 years and killed more than 70,000 people on this teardrop-shaped island off India's southern tip.
"The sky is the limit. Whatever the country can afford, they get," Wanasinghe said.
Senior officials, analysts, diplomats and former military officers say President Mahinda Rajapaksa's commitment to the fight — coupled with a string of miscalculations by the Tamil Tigers — has brought one of the world's most sophisticated rebel groups to the brink of defeat.
In recent weeks, government forces have broken through the rebels' front lines, forced them out of much of their de facto state in the north and cornered them in a shrinking pocket of northeastern jungle.
Top officials predict the imminent demise of the Liberation Tigers of Tamil Eelam and its dream of creating a breakaway state for the country's ethnic Tamil minority in the north and east.
If Sri Lanka succeeds, it could signal the end of one of Asia's most persistent and bloody insurgencies. But a lasting peace will depend on whether the 75 percent Sinhalese majority on the island of 20-million people can come to a political compromise with the Tamils.
The Tamils have long felt the government, dominated by the Sinhalese, has discriminated against them, their culture and their language.
Rajapaksa has said he would seek a political resolution to the ethnic conflict once the rebels were destroyed. But Sinhalese nationalist politicians have already said that with victory in sight there was no need for the sort of power-sharing arrangement seen as crucial to placating the Tamils and preventing a new outbreak of violence.
By some estimates, the retreating rebels still have as many as 10,000 hard-core cadres and another 10,000 reservists still ready to fight.
Iqbal Athas, a military analyst for Jane's Defense Weekly, cautioned against declaring an early victory. "The war is not yet over," he said. "It could be protracted."
Some of the insurgents could take off their uniforms, blend in with the mass of civilians still living in their stronghold, and fight on as guerrillas, said Austin Fernando, a former defense secretary.
The war that led to the murder of a former Indian prime minister erupted in 1983 after a rebel ambush in the northern Tamil city of Jaffna killed 13 soldiers. Vengeful Sinhalese mobs rampaged through Colombo, the capital 190 miles to the south, leaving more than 2,000 Tamils dead, according to human rights groups.
The army of about 40,000 was unprepared for the brutal fighting that ensued, said Wanasinghe.
"Our army was mainly for containing internal unrest. It was not trained for war," the ex-military chief said.
The military soon realized that the rebels, with their rocket-propelled grenades and makeshift armored tractors, were better armed than the troops, he said. The air force was reduced to bombing the rebels with barrels of explosives rolled out the doors of transport planes, he said.
Over time, the violence would spike and ebb. India, with its own sympathetic Tamil community, sent in peacekeepers in 1987, but they soon became targets of the rebels and left in 1990. The following year, Rajiv Gandhi, who as Indian prime minister had ordered in the peacekeepers, was killed by a Tamil Tiger female suicide bomber in southern India.
Hoping to limit casualties and the mounting expense of the war, Sri Lankan governments vacillated between fighting and seeking peace, with different officials in the same government often working at cross purposes, said Fernando. And while the military did its best to get new equipment and modernize — buying fighter jets and attack boats — it never was properly funded, he said.
Norwegian mediators brokered a cease-fire in 2002. But in 2005 Rajapaksa was elected president and after a brief stab at peace talks, he committed himself to all-out war. A year ago, he withdrew from the cease-fire.
A recruitment drive expanded troop levels by 40 percent, Defense Secretary Gotabhaya Rajapaksa said, and the defense budget hit a record $1.6-billion.
In previous administrations, "the soldiers were getting mixed signals," said Rajapaksa, who is the president's brother. "Here there was no ambiguity in the aim. It was very clear: Destroy the LTTE. That was clear from the first day to the last day."
"We had a plan," he said. "We knew what strength we needed. We knew what equipment we needed. … We gave those to the commanders so the commanders had greater flexibility."
The government ignored international pressure to restart peace efforts and shrugged off accusations from human rights groups that it sanctioned extrajudicial killings, allowed paramilitaries to run amok, and disregarded the safety of civilians.
Rights groups also accused the rebels — listed as a terror group by the United States and the European Union — of forcibly conscripting child soldiers and holding the civilian population under their control hostage.
Now the rebels are huddled in the northeastern jungles along with hundreds of thousands of civilians, many of them war refugees living in shelters.
Jehan Perera, a Sri Lankan political analyst, said much more work will be needed before Sri Lanka is fully at peace.
"Ultimately, this is a conflict between the two largest communities that live on this island and that is not resolved," he said.