SEOUL, South Korea (AP) — Former President Kim Young-sam, who formally ended decades of military rule in South Korea and accepted a massive international bailout during the 1997-1998 Asian financial crisis, died Sunday. He was 87.

The chief of Seoul National University Hospital, Oh Byung-Hee, told a televised briefing that Kim died there early Sunday. He said Kim is believed to have suffered from a severe blood infection and acute heart failure before he died.

Kim was taken to the hospital on Thursday due to a high fever, Oh said. In recent years, Kim had been treated at the hospital for stroke, angina and pneumonia, Oh added.

Kim was an important figure in South Korea's pro-democracy movement and opposed the country's military dictators for decades. As president, Kim laid the foundation for a peaceful power transfer in a country that had been marked by military coups.

During his presidency from 1993-1998, he had his two predecessors indicted on mutiny and treason charges stemming from a coup. Still, Kim pardoned the two convicted military strongmen — Chun Doo-hwan and Roh Tae-woo — at the end of his term.

Kim also launched a popular anti-corruption campaign and vowed not to receive any political slush funds, though this was later tarnished when his son was arrested on charges of bribery and tax evasion.

He led South Korea in 1994 when the Clinton administration was considering attacking Nyongbyon — home to North Korea's nuclear complex — north of communist North Korea's capital, Pyongyang. Kim lobbied against the idea, fearing a possible war.

A U.S. aircraft carrier and a cruiser had been deployed near South Korea's east coast in preparation for a possible airstrike, and the United States planned to evacuate Americans, including its soldiers and their families, Kim said in a memoir.

A U.S. airstrike "will immediately prompt North Korea to open fire against major South Korean cities from the border," Kim said in his memoir, describing his dawn telephone conversation with President Bill Clinton in June 1994.

The crisis eased when former President Jimmy Carter met with the North's leader and founder Kim Il Sung, the grandfather of current ruler Kim Jong Un, in Pyongyang, which led to an accord aimed at freezing North Korea's plutonium-based nuclear programs.

That deal collapsed in 2002 when the United States accused North Korea of running a secret uranium-based program, sparking another nuclear crisis.

After years of denials, North Korea announced in 2009 that it was enriching uranium, a process that gave it a second way to make nuclear bombs.

During the '94 crisis, Carter tried to arrange a summit between Kim and the North's founder — in what would have been the first such meeting between the leaders of the two Koreas since the 1950-53 Korean War that ended in a ceasefire, not a peace treaty.

But the summit didn't take place because the North's Kim suddenly died of heart attack in July 1994. It took six years before the leaders of the two Koreas — South Korean President Kim Dae-jung and his North Korean counterpart Kim Jong Il — held a summit in Pyongyang. Kim Jong Il was the father of Kim Jong Un.

North Korea continued to cause security jitters for rival South Korea during Kim's presidency. In 1996, a North Korean submarine ran aground off South Korea's eastern shores.

The North later expressed its "deep regret" for the intrusion that left 24 North Korean agents and 13 South Koreans dead. It was an unprecedented apology from the North — though it said the sub drifted into southern waters while on a routine training exercise.

Kim was credited with disbanding a key military faction and bringing transparency to the South's murky financial system. But he was also accused of mismanaging the economy during the Asian financial crisis that toppled some of the country's debt-ridden conglomerates and forced the government to accept a $58 billion bailout from the International Monetary Fund.

Kim was born into a rich fishing family on Dec. 20, 1927, in Geoge Island off the southeastern tip of the Korean peninsula when the country was still under Japanese colonial rule. During the Korean War, he anchored a defense ministry propaganda radio program.

In 1954, Kim was elected as the youngest member of the National Assembly. At that time, he was a member of the ruling party of the late Syngman Rhee, South Korea's first president.

But a few months later, he broke with the ruling party in protest over a constitutional revision and joined the opposition party, drawing anger from military rulers.

In 1979, Kim was expelled from the assembly for his anti-government activities, shortly before then President Park Chung-hee — who seized power in a military coup in 1961 — was assassinated by his intelligence chief.

During that chaotic period, Maj. Gen. Chun Doo-hwan and his military cronies rolled tanks and troops into Seoul to seize power in another coup that ended an interim government.

In the early 1980s, Kim was placed under house arrest twice and staged a 23-day hunger strike to protest political oppression.

Kim spent more than three decades in opposition as an advocate for democracy, though he later joined hands with military leader Roh Tae-woo and others to create a new ruling party.

In 1992, Kim became the head of the ruling party and was elected president, five years after his first unsuccessful presidential bid.

Kim is survived by his wife and two sons and three daughters.

____

This version corrects the spelling of Kim's birthplace to Geoge Island, instead of Koje Island.

____

Former Associated Press writer Kim Kwang-tae and Associated Press writer Kim Tong-hyung contributed to this report.