FILE - In this Sept. 18, 2008 file photo, Peru's President Alan García smiles during the opening ceremony of Expo Peru 2008 in Sao Paulo, Brazil. Current Peruvian President Martinez Vizcarra said Garcia, the 69-year-old former head of state died Wednesday, April 17, 2019, after undergoing emergency surgery in Lima. Garcia shot himself in the head early Wednesday as police came to detain him in connection with a corruption probe. (AP Photo/Andre Penner, File)

LIMA, Peru (AP) — Alan García, a former Peruvian president whose first term in the 1980s was marred by financial chaos and rebel violence, and who was recently targeted in Latin America's biggest corruption scandal, shot himself and died on Wednesday at the age of 69.

President Martin Vizcarra announced on Twitter that García died after undergoing emergency surgery for a bullet wound hours earlier.

García killed himself before being detained by police amid allegations he received illegal payments from Brazilian construction giant Odebrecht after Peruvians voted him back into the presidency for a second term in 2006.

A lifelong politician, García's career was marked by epic triumphs and devastating setbacks in a rollercoaster of a public life fueled by his charisma and capacity for reinvention.

He was "condemned to become president again and again," a former president, Fernando Belaunde, once said.

García became an increasingly isolated figure whose claims that the Odebrecht corruption probe was politically motivated failed to resonate among a public accustomed to intrigue and machinations at the highest levels of government.

The scandal also ensnared three other former heads of state and a long string of powerful officials as Peru went further than any other country outside Brazil in prosecuting politicians tied to the Odebrecht probe

But García's bid for a reconstructed political legacy long after the darkest days of the Maoist Shining Path insurgency that marked his first term in office fell short as investigators closed in on him.

He maintained his innocence until his death, arguing that he was the victim of false testimony alleging that he took bribes from Odebrecht during the construction of Lima's metro during his 2006-2011 government.

He was never charged.

FILE - In this July 28, 2006 file photo, Peruvian President Alan García waves to a crowd after his swearing-in ceremony while he walks through the streets of Lima, Peru. Current President Martinez Vizcarra said Garcia, the 69-year-old former head of state died Wednesday, April 17, 2019, after undergoing emergency surgery in Lima. Garcia shot himself in the head early Wednesday as police came to detain him in connection with a corruption probe. (AP Photo/Ernesto Benavides, File)
FILE - In this July 29, 2006 file photo, Peruvian President Alan García waves to supporters as he arrives at a military parade marking Independence Day in Lima, Peru. Current President Martinez Vizcarra said Garcia, the 69-year-old former head of state died Wednesday, April 17, 2019, after undergoing emergency surgery in Lima. Garcia shot himself in the head early Wednesday as police came to detain him in connection with a corruption probe. (AP Photo/Karel Navarro, File)
FILE - In this Dec. 14, 2007 file photo, President Bush signs the U.S.-Peru Trade Promotion Agreement Implementation Act as Peruvian President Alan García looks on at left, in the Eisenhower Executive Office Building in Washington. Current Peruvian President Martinez Vizcarra said Garcia, the 69-year-old former head of state died Wednesday, April 17, 2019, after undergoing emergency surgery in Lima. Garcia shot himself in the head early Wednesday as police came to detain him in connection with a corruption probe. (AP Photo/Ron Edmonds, File)
FILE - In this June 1, 2006 file photo, presidential candidate Alan García of the American Popular Revolutionary Alliance, or APRA, waves a Peruvian flag during his closing campaign rally in Lima, Peru. Current Peruvian President Martinez Vizcarra said Garcia, the 69-year-old former head of state died Wednesday, April 17, 2019, after undergoing emergency surgery in Lima. Garcia shot himself in the head early Wednesday as police came to detain him in connection with a corruption probe.  (AP Photo/Lucho Gonzales, File)
FILE - In this Dec. 9, 2006 file photo, Peru's President Alan García laughs out accompanied by Venezuelan President Hugo Chavez and of Bolivian President Evo Morales, as they break apart after gathering for a group photo at the Community of South American Nations summit, in Cochabamba, Bolivia. Current Peruvian President Martinez Vizcarra said Garcia, the 69-year-old former head of state died Wednesday, April 17, 2019, after undergoing emergency surgery in Lima. Garcia shot himself in the head early Wednesday as police came to detain him in connection with a corruption probe. (AP Photo/Dado Galdieri, File)
FILE - In this Nov. 23, 2008 file photo, Peru's President Alan Garcia, right front, smiles as leaders gather for the official group photo of 16th Asian Pacific Economic Cooperation Summit, APEC, in Lima, Peru. Current Peruvian President Martinez Vizcarra said Garcia, the 69-year-old former head of state died Wednesday, April 17, 2019, after undergoing emergency surgery in Lima. Garcia shot himself in the head early Wednesday as police came to detain him in connection with a corruption probe. (AP Photo/Dado Galdieri, File)
A Supporter of former Peruvian President Alan Garcia cries as she learns that the former leader died from a self-inflicted gun shot, outside the hospital where he was taken after he shot himself, in Lima, Peru, Wednesday, April 17, 2019. Peru's current President Martinez Vizcarra said Garcia, the 69-year-old former head of state died after undergoing emergency surgery. Garcia shot himself in the head early Wednesday as police came to detain him in connection with a corruption probe. (AP Photo/Martin Mejia)
FILE - In this July 11, 2011 file photo, Peru's outgoing President Alan García, left center, rides the new Line 1 electrical train system, in Lima, Peru.  Current Peruvian President Martinez Vizcarra said Garcia, the 69-year-old former head of state died Wednesday, April 17, 2019, after undergoing emergency surgery in Lima. Garcia shot himself in the head early Wednesday as police came to detain him in connection with a corruption probe.  (AP Photo/Martin Mejia, File)
FILE - In this July 28, 1988 file photo, Peruvian President Alan García marches in front of palace guards at a military ceremony in Lima, Peru. Current Peruvian President Martinez Vizcarra said Garcia, the 69-year-old former head of state died Wednesday, April 17, 2019, after undergoing emergency surgery in Lima. Garcia shot himself in the head early Wednesday as police came to detain him in connection with a corruption probe.  (AP Photo, File)
FILE - In this May 15, 1988 file photo, President of Peru Alan García visits with Pope John Paul II in the Presidential Palace, in Lima, Peru. Current Peruvian President Martinez Vizcarra said Garcia, the 69-year-old former head of state died Wednesday, April 17, 2019, after undergoing emergency surgery in Lima. Garcia shot himself in the head early Wednesday as police came to detain him in connection with a corruption probe.  (AP Photo, File)