Hungary is set to back entry into the European Union by a large majority, according to first results from Saturday's referendum.
Hungary celebrates an embarrassing result
With more than 99% of ballots counted, returns showed about 84% of voters backing entry, the Hungarian Electoral Committee announced.
Fireworks exploded in the night sky above the River Danube in the capital to the strains of Beethoven's Ninth Symphony - the EU anthem - as the authorities welcomed the result.
But turnout was only about 46% suggesting many Hungarians had expressed their disapproval or fears about membership by staying away from voting stations, the BBC's Nick Thorpe reports from Budapest.
This was much less than the resounding "yes" the government had been hoping for, our correspondent says, and somewhat embarrassing for Hungary.
Prime Minister Peter Medgyessy put a brave face on the result nevertheless.
The citizens of Hungary, he said in a speech in front of the Academy of Sciences, like good parents, had provided a future for their children.
Hungary is the third of 10 countries invited to join the EU in May 2004 to put the question to a vote.
Our correspondent says the campaign for the referendum appeared weighed in its favour from the outset, buoyed by "yes" votes in Malta and Slovenia.
Nick Thorpe notes that an EU communications office was set up by the centre-left government and ran a slick and very modern campaign.
A digitalised telephone centre fielded hundreds of thousands of questions but enquirers were faced with standard responses.
DECIDING THIS YEAR
8 March - Malta
23 March - Slovenia
12 April - Hungary
16-17 May - Slovakia
10-11 May - Lithuania
8 June - Poland
15-16 June - Czech Republic
14 September - Estonia
20 September - Latvia
The Greek part of Cyprus is due to sign an EU accession treaty on 16 April
Critics say real experts, knowledgeable enough to answer real questions, would have been more effective.
Public meetings around the country have been more popular, dealing with worries about new regulations, workplaces and prices.
The centre-left government has underlined that accession will be good for everyone.
The centre-right Fidesz Party, led by former Prime Minister Victor Orban, warns that many could suffer initially, but that the EU will be good for Hungary in the long run.
Battling against almost the entire political establishment, a small cluster of right wing groups and individuals called for a "no" vote, arguing that the country was being sold out to foreign capital and that Hungarian smallholders in particular would suffer.