Hungary's parliament on Tuesday approved leaving the International Criminal Court, which it calls "politically motivated", becoming the third country after Burundi and the Philippines to take such a step.
Prime Minister Viktor Orban announced during a visit by Israeli Prime Minister Benjamin Netanyahu last month that his European Union country would leave the ICC.
Orban hosted Netanyahu despite an ICC arrest warrant.
The global tribunal accuses the Israeli leader of war crimes in Gaza -- allegations he rejects.
In Hungary's parliament, 134 lawmakers voted in favour of the proposal to leave the ICC, while 37 voted against and seven abstained.
Once the decision is promulgated, Hungary will notify the United Nations, Foreign Minister Peter Szijjarto said.
He alleged the ICC had become a "politically motivated judicial body", which was "unacceptable".
"It's clear that Hungary has no place in such an organisation," he said in a statement.
Withdrawal from the ICC takes effect one year after the deposit of the withdrawal's instrument -- usually a formal letter declaring the pullout -- with the UN secretary general's office.
Last month's visit to Hungary was Netanyahu's first trip to Europe since 2023.
The ICC issued arrest warrants in November for Netanyahu and former Israeli defence minister Yoav Gallant over allegations of crimes against humanity and war crimes -- including starvation as a method of warfare -- in Israel's war in Gaza.
They also issued an arrest warrant for Hamas military chief Mohammed Deif. The case against Deif was dropped in February after his death.
Set up in 2002, the ICC, based in The Hague, seeks to prosecute individuals responsible for the world's gravest crimes when countries are unwilling or unable to do so themselves.
A total of 125 countries have ratified the court's founding Rome Statute, meaning they recognise its jurisdiction.
The United States and Russia are not members. Nor are Israel, China and Myanmar.
So far only Burundi and the Philippines have become members and then withdrawn from the court.
Hungary signed the Rome Statute -- which established the court -- in 1999 and ratified it two years later during Orban's first term in office.