SEOUL, South Korea — Kim Jong-pil, a two-time South Korean prime minister who helped engineer a military coup, founded the country’s intelligence agency and facilitated the rise of three presidents, but who never managed to win the presidency himself, died on Saturday in Seoul, the capital. He was 92.

Mr. Kim’s death was announced by his family and by the South Korean government. He had been taken to Soon Chun Hyang University Hospital in Seoul early Saturday after having difficulty breathing and was pronounced dead on arrival. No specific cause was given.

Mr. Kim was the last of the “Three Kims,” as they were universally known in South Korea. The trio — including two presidents, Kim Young-sam, who died in 2015; and Kim Dae-jung, who died in 2009 — dominated national politics for decades, notably during the country’s turbulent transformation from military dictatorship to vibrant democracy.

A suave, witty deal maker, Kim Jong-pil stood out from the other two Kims, both of whom were known for being fiery and headstrong. He was the original kingmaker in South Korea’s fractured, regionally based political system, in which parties were dispersed and realigned at their leaders’ whims.