SEOUL, South Korea - Former President Kim Young Sam, 87, who formally ended decades of military rule in South Korea and accepted an international bailout during the 1997-98 Asian financial crisis, died Sunday.

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

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

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

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

He also launched a popular anticorruption 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 Pyongyang. Mr. 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, Mr. 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," he wrote 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 1994 crisis, Carter tried to arrange a summit between Mr. 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 war.

But the summit did not take place because the North's Kim died of a 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 Mr. 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, which 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.

Mr. 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.