Cardinal Miguel Obando y Bravo, who was caught up in the turbulent politics that consumed Nicaragua for much of his adult life, at one time opposing Sandinista leaders and later defending them, died on Sunday at his home in Managua, the country’s capital. He was 92.

The cause was a heart attack, a spokesman for the Roman Catholic Church in Managua said.

Few Nicaraguans could argue when President Daniel Ortega, in conferring a decoration on Cardinal Obando in 2012, called him “one of the most important personalities in modern Nicaraguan history.”

He rose from poverty to great political and ecclesiastical power and made waves of enemies as he swept back and forth across the political spectrum. Many Nicaraguans loved him at some points in his career and detested him at others.

“Obando was a typical product of our society, which is still rural in its culture of power,” said the novelist Sergio Ramírez, who was vice president of Nicaragua in the 1980s.