LIMA (Reuters) - Alan Garcia was the charismatic chameleon of Peruvian politics, once popular enough to be elected president twice. But his terms were filled with ups and downs and he eventually became caught up in the Odebrecht bribery scandal that rocked Latin America.

FILE PHOTO: Peru's new President Alan Garcia waves after leaving the Congress where he received the presidential red-and-white sash during his inauguration ceremony in Lima, Peru July 28, 2006. REUTERS/Ivan Alvarado/File Photo

Garcia, 69, fatally shot himself in the head on Wednesday at his home in Lima as police waited in another room to arrest him in the Odebrecht case, which has ensnared three other former Peruvian presidents.

Garcia had denied the corruption allegations that had long dogged him until the end, saying he was victim of political persecution.

“Others might sell out, not me,” he told journalists in some of his last public comments on Tuesday, repeating a phrase he used often as his foes became ensnared in the bribery investigation into Brazilian builder Odebrecht in recent years.

The son of an accountant and a schoolteacher, Garcia became one of Latin America’s greatest orators and governed Peru as a firebrand leftist from 1985-1990. He remade himself as a champion of foreign investment and free trade to win another five-year term in 2006.

Garcia benefited from his family’s connections with Victor Raul Haya de La Torre, the founder of Apra, which was once Peru’s largest and most powerful political party.

After earning a law degree in Lima and studying political science in Madrid, he won a seat in Congress and in 1985 became Apra’s first president at age 36. He had promised to bring historically excluded Peruvians into the political fold and extend the country’s vast minerals wealth to the millions who lived in desperate poverty.

He once enjoyed tremendous support - near 90 percent at his height - and was touted as Peru’s John F. Kennedy.

But the popularity soon began to crack. In June 1986, security forces killed hundreds of rioting guerrilla inmates in Lima jails, putting in doubt Garcia’s reputation as a defender of human rights.

Slideshow ( 4 images )

His approval sank further when he tried to nationalize banks in 1987 and refused to pay foreign debt, alienating the business class and sparking a deep recession.

The end of his term was marred by an escalating war with Shining Path guerrillas, hyperinflation surpassing 2,000,000 percent and accusations of widespread corruption.

In July 1990, he left office in disgrace.

A SECOND CHANCE

Garcia was down but not out.

After spending nine years abroad to avoid corruption probes, he eventually returned to Peru and charmed his way back into politics by convincing voters he had returned older and wiser.

He ran and lost the 2001 presidency but succeeded in re-creating his image. This time, Garcia promised, he would avoid of the mistakes of his first presidency and would control spending, attract investment and handle insurgent rebels with a heavy hand.

In 2006, Garcia again ran for the presidency and eked out a win, defeating Ollanta Humala, who had spooked investors and was closely connected in many voters’ minds with the socialist politics of Venezuela’s late former president Hugo Chavez.

In his second term, a visibly pudgier Garcia oversaw explosive economic growth. He brought billions of dollars of mining and energy investment to Peru and is credited with opening its economy to the world.

The country became a darling of global investors under his watch but his popularity continued to sink after he left office in 2011, in part due to thousands of pardons his government granted to drug traffickers in his second term.

Garcia, who had six adult children, ran for president again in 2016 but came in a distant fifth in a race of 10. He resigned as president of Apra and urged members to revamp the party without him.

Garcia was one of nine people whom a judge had ordered arrested in connection with the bribery investigation into Odebrecht on Wednesday. But he shot himself after police arrived to arrest him and died at a hospital hours later.

President Martin Vizcarra, who Garcia had accused of trying to silence him, ordered Peru’s flags to be flown at half staff.