Marine Le Pen's far-right party edged just ahead of the centrist alliance of President Emmanuel Macron in exit polls as French voters led what pollsters expected to be a nationalist surge in an EU parliament election on Sunday.
The defeat was narrow - just one seat - but a bitter one for for those who hope the French leader can inspire Europeans to embrace the Union as an answer rather than part of the problem in the face of what for many is nerve-wracking social change.
However, a first official projection of all 751 seats by the European Parliament indicated that losses for the pro-EU center may have been no worse than expected, with the Greens and liberals also gaining at the expense of the center-right and center-left.
Brussels officials and pro-EU party leaders also took heart from a substantial increase in turnout -- the first in the 40-year history of direct elections to the Parliament.
It was about 50%, up from 43% in 2014 - hardly massive, but an end to the declines that have fueled talk of a "democratic deficit" that undermines the legitimacy of EU lawmaking.
Dropping about 40 seats each, the conservative European People's Party and Socialists & Democrats lost the majority they formed in a "grand coalition" with the EPP on top, according to the projection.
Gains for the liberal ALDE and its allies under Macron put them in the frame for a bigger say. The Greens, in fourth place, could be kingmakers as the Socialists eye their chances of taking a lead, despite again trailing the EPP by 20-30 seats.
The elections have consisted of four days of ballots across the 28-nation bloc. A clearer picture of the legislature will come once the final polls close - in Italy at 2100 GMT.
The far-right League of Deputy Prime Minister Matteo Salvini stands a chance of pipping Chancellor Angela Merkel's German conservatives as the party with the largest number of seats in the chamber.
Another contender will be the new Brexit Party of veteran British anti-EU campaigner Nigel Farage, set to top the vote in the country that was supposed to have left the bloc two months ago.
He is determined to make the departure happen and that his MEPs will not sit for long - though drama after the resignation of Prime Minister Theresa May leaves the fate of Brexit still very uncertain.
In France, an official in Macron's team acknowledged "some diasppointment" that, with some 22%, the president's Renaissance movement had lost first place to Le Pen's National Rally, which exit polls put on 24%. However, pro-EU parties were still in the majority, with the French Greens coming third.
Added to the dazzling second place of their German counterparts, that lent credibility to expectations of a "green wave" that will influence policy in Brussels in the coming years.
The Parliament's forecast put the EPP on 173 seats, ahead of the S&D on 147, with the liberals on 102, up 33 seats, and Greens on 71, up 19.
On the far-right, two groups in the current parliament had a combined 113 seats, a 50% gain from 2014.
Other parties may also add to the anti-EU firepower - such as the ruling parties in Poland and Hungary, and a new far-right movement in Spain. However, divisions among nationalist groups have limited their effectiveness in blocking EU policymaking.
In Germany, the biggest member state and one of 21 countries that voted on Sunday, an exit poll for public broadcaster ARD showed the Greens on 22%, Merkel's Christian Democrats (CDU) and their conservative allies on 28%, down eight points from 2014, and the Social Democrats slumping nearly 12 points to 15.5%.
On a night when German political attention was focused on the CDU's narrow defeat of Merkel's national coalition partner the SPD in the small city-state of Bremen, a left-wing bastion, the far-right Alternative for Germany (AfD) raised its share of the EU vote by 3.4 percentage points to 10.5%.
As the European Parliament in Brussels prepared for the EU-wide count, Brussels police detained dozens of "yellow vest" protesters, part of a movement that began in France to voice discontent with the political establishment.
And outside the Belgian capital, a new far-right surge was evident in a national election that also took place on Sunday. The far-right Vlaams Belang surpassed expectations in the richer half of the country, running second in wealthy Flanders.
The European Parliament election will usher in weeks and possibly months of hard bargaining over who will run EU institutions. Party spokespeople for the four pro-EU center parties were quick to talks of plans for a broad coalition.
The Parliament as an institution has insisted that one of its own winning members should succeed Jean-Claude Juncker as president of the executive European Commission. But many national leaders, who will meet over dinner in Brussels on Tuesday, have said they will not be bound by that demand.