Hungary's decision to allow ethnic Hungarians living abroad to apply for dual citizenship has sparked an angry response from neighbouring Slovakia.
Slovakia has voted to amend its own citizenship law, stripping anyone of their Slovak citizenship if they apply for a second nationality.
Southern Slovakia is home to roughly 500,000 ethnic Hungarians, about a tenth of the country's population.
Slovak leader Robert Fico has called Hungary's move a "security threat".
The two EU members have repeatedly sparred over the treatment of the substantial Hungarian minority in Slovakia, most recently about a new language law which Hungary says hurts minority rights.
The amendment to Hungary's citizenship law passed almost unanimously in the Hungarian parliament on Wednesday.
Slovakia retaliated by passing its own measure later in the day.
The Hungarian measure is due to come into effect in 2011, while the Slovak one, which still needs approval from the president, would come into force in July, Reuters news agency reported.
The Hungarian law will allow ethnic Hungarians living abroad to apply for Hungarian citizenship, if they speak Hungarian and have Hungarian ancestry.
This was one of the campaign pledges of incoming Prime Minister Viktor Orban and his centre-right Fidesz party, which won a landslide majority in elections in April.
Of Hungary's neighbours, only Slovakia has objected to the move.
Mr Fico told the Slovak parliament on Tuesday that Hungary was attempting to revise history, and accused Hungary of gross ignorance of the bilateral friendship treaty, the BBC's Nick Thorpe reports from Budapest.
Hungary ceded two-thirds of its territory under the 1920 Treaty of Trianon, after being on the losing side in World War I. As a result, large Hungarian minorities now live in neighbouring Slovakia, Romania and Serbia.
Bratislava is particularly upset that Hungary did not seek talks before passing the amendment, our correspondent says.
Slovakia will hold parliamentary elections next month, and Mr Fico is battling for the nationalist vote, he adds.