Hungarian President Tamas Sulyok on Saturday announced he would sign a constitutional amendment immediately ending his term in office, an act that Prime Minister Peter Magyar later confirmed had been done.

Sulyok, an ally of Hungary's long-serving nationalist ex-Prime Minister Viktor Orban, said, "I am fulfilling my obligation under the Fundamental Law [Hungary's constitution] after carefully weighing my legal options and my conscience."

The amendment, passed on Monday by Magyar's ruling Tisza party, is part of a concerted effort to rid the EU member state of the last remnants of Orban's far-right political machine after voters booted Orban and his Fidesz party from office in April elections.

Until now, Sulyok has staunchly resisted calls by Magyar and his pro-EU party to step down on grounds that voters had lost confidence in him as well as accusing him of thwarting progress on matters of national interest.

On Saturday, Sulyok said he had no choice but to sign the legislation, which he criticized as setting a "negative precedent that inflicts a deep wound on the constitutional values of democracy, the separation of powers and the rule of law" — all issues for which Brussels heavily criticized and even sanctioned Hungary while Orban and Fidesz were in power.