The Roman Catholic Church has a long history of excommunicating people. These days it is mostly constrained to excommunicating bishops who break with doctrine.
The Pope regularly sends letters to political figures touching on political matters. (Russian President, Australian Prime-minister, UN Secretary General). How long has it been since the Church "threw its weight around" and actually excommunicated someone, because of what they wanted to happen, in terms of national policy?
I'm looking for the most recent case of the Roman Catholic Church excommunicating a politician or government (eg a head of state/government, a chief bureaucrat), as part of "Meddling in national politics".
I'm only interested in the excommunication of clergymen, if they were both government officials (outside of the Holy See), and the political reason was related to national politics (Eg declaring war on another country).
With the explicit exclusion of excommunicating someone who practiced outright warfare against the Church, or the Holy See. This should also implicitly exclude Automatic Excommunication.
Also excluding anyone that had the excommunication revoked/reversed, shortly after. If the excommunication wasn't revoked til over a decade later than that would be applicable (though I'ld expect an answer to mark as such).
Best I can find is King Jame IV of Scotland in 1513 (by Pope Leo X) for breaking the treaty of Treaty of Perpetual Peace. However, is not entirely clear to me as to if this was done for political reasons, or if it was done for religious reasons -- he violated a sworn oath before God.