Hungary's ruling party, the right-wing Fidesz, is to leave the largest grouping in the European Parliament.
The European People's Party (EPP) voted overwhelmingly in favour of changing its internal rules in a move that would have made it easier to expel Hungarian Prime Minister Viktor Orban's party.
Mr Orban denounced the decision as "anti-democratic" and announced Fidesz's withdrawal from the bloc.
He and the EPP have long been at odds over his democratic record in Hungary.
The party had been suspended from the centre-right EPP since 2019 over concerns about human rights in Hungary and its attacks against the EPP leadership.
On Wednesday, members of the EPP voted 148 to 28 in favour of a decision which would allow them to suspend or dismiss entire national parties.
In a letter shared on Twitter, Mr Orban described the changes to the EPP rules as "a hostile move against Fidesz and our voters".
"This is antidemocratic, unjust and unacceptable," the Hungarian leader continued, adding that the 12 Fidesz members would leave the EPP immediately.
The European group, whose members include German Chancellor Angela Merkel's CDU, will remain the largest bloc in the European Parliament.
Tensions between Fidesz and the EPP escalated two years ago, when Mr Orban's party turned its anti-EU rhetoric against senior EPP members.
Fidesz commissioned posters featuring EPP member and then European Commission President Jean-Claude Juncker, alongside a photograph of the Hungarian-born billionaire philanthropist George Soros - who is frequently the target of conspiracy theories and anti-immigration rhetoric.
The image was captioned "you too have a right to know what Brussels is preparing" and accused Mr Juncker of pushing a pro-immigration plan backed by Mr Soros.
But relations between the EPP and the Hungarian party continued to sour.
In December last year, the EPP suspended the head of the Fidesz delegation, Tamas Deutsch, after he compared EPP head Manfred Weber to the Nazis' secret police force, the Gestapo.
Souring of relations in Europe
After 21 years in the bosom of the European People's Party, Viktor Orban jumped before he was pushed. All 12 Fidesz MEPs will now leave before they can be expelled.
This was a bitter end to what began as a genuine love affair. The EPP for a long time enjoyed the presence of Fidesz and its young, supremely successful leader in its ranks.
For his part, Orban skilfully used EPP membership to project his own and his party's policies far beyond his small east European country.
Since his re-election in 2010, 2014 and especially 2018, disquiet has grown among European Christian Democrats about both his domestic policies and his claim to represent genuine Christian Democracy.
In the elections to the European Parliament in 2019, Viktor Orban hoped to split the EPP, taking part in a new alliance of European right-wing parties including Matteo Salvini's League, Giorgia Meloni's Brothers of Italy and the Polish Law and Justice Party.
In the end the EPP decided Orban was the problem, not the solution.