LONDON — As the bands played on at the Glastonbury music festival in Somerset, England, Lewis Phillips and his friends drowned their sorrows in song and alcohol.

“We’re the ones who’ve got to live with it for a long time, but a group of pensioners have managed to make a decision for us,” Mr. Phillips, 27, said on Friday of Britain’s decision to withdraw from the European Union. He said he was now “terrified” about the country’s economic prospects.

Louise Driscoll, a 21-year-old barista in London, spent most of the day crying. “I had a bad feeling in my gut,” she said of Britain’s referendum on Europe. “What do we do now? I’m very scared.” Her parents both voted to leave the bloc, she said, and “will probably be gloating.”

According to pre-election surveys by the polling organization Survation, 57 percent of Britons between the ages of 18 and 34 who intended to take part in Thursday’s referendum supported remaining in the bloc, while an identical proportion — 57 percent — of Britons over 55 supported the opposite: leaving Europe behind.

For those under 25, the desire to remain in the union was especially high: Three-quarters wanted Britain to stay in Europe.

Many young people in Britain have grown up thinking of European integration as a given, not a political experiment that would be rolled back before they could fully take part in it.

They are often more comfortable living in a multicultural society than their elders are, particularly in cities like London and Edinburgh, which are flooded by people from across the Continent to study and work.

Many young Britons expressed astonishment, anger or despair that their parents and grandparents would seek to limit the travel, exposure to other cultures and opportunities to work and study abroad that being part of the European Union has afforded them.

“Truly gutted that our grandparents have effectively decided that they hate foreigners more than they love us and our futures,” one young Briton, Dan Boden, wrote on Twitter.

The referendum hinged in part on youth turnout, and the government even tried to lower the voting age for the referendum to 16 from 18.

It failed, but the Remain campaign still pushed to register young voters, with some success: The deadline to register was extended by two days after a voter-registration website crashed because it was overwhelmed by visitors.

Prime Minister David Cameron turned to Tinder, the dating app, and TheLADbible, a website popular among young men, to tout the benefits of staying in the European Union. The opposition Labour Party, which supported remaining in the bloc, also reached out to young voters.

More than one million people between 18 and 34 registered in recent months, the most ever for a British election, according to Bite the Ballot and HOPE Not Hate, which encourage young people to vote. Turnout for the referendum, at around 72 percent, was the highest for any national election in Britain since 1992.

But it was not enough.

“Waking up to the #EURefResults and realizing the older generation have just ruined our future,” one young Briton, Toby Pickard, wrote on Twitter.

Another, Sarah Hartley, wrote that “our economy is in tatters” because “our grandparents cared more about their comfort than our future.”

In Edinburgh, a university city with a strongly pro-European bent, Robert Jack, a 21-year-old student at the University of Glasgow, was reeling from the decision. He worried that his plans to study in Romania on the European Union’s student-exchange program, Erasmus, were in jeopardy.

The vote “is very damaging,” Mr. Jack said, adding that he now welcomed a second referendum on whether Scotland should leave the United Kingdom, because “it’s better being inside the European Union.”

Image

Watching the referendum results at a pub in north London after the vote on Thursday.CreditAndrew Testa for The New York Times

Of course, many young people supported the push to rid themselves of Europe. Ben Kew, 21, said he spent 30 hours at the Leave headquarters, watching the results come in.

“I was surprised; I didn’t think we’d go through with it, but I’m pleased that the establishment has been given a kick,” he said, adding that the vote was a moment when Britons expressed a desire for real change.

But many young voters wondered what would happen to European Union funding for research and sciences. British universities currently receive about 16 percent of their research money and staff members from the European Union.

James Calderbank, 21, a student at Falmouth University in Cornwall, England, wrote in an email: “Since the early hours of this morning my Facebook newsfeed has been filled with my friends’ disappointment that we are leaving the E.U.”

He added: “Our campus was part-funded by the E.U., so things are really not looking good for my university and its source of funds.” Cornwall, as a fairly rural and less-developed part of southwest England, was also a beneficiary of economic aid from Brussels, he noted.

Some high-school students expressed dismay as well. “There is a very clear rift between how us young people feel and how the oldest age groups feel,” Elliot Shirnia, 18, a student at the Marling School in Gloucestershire, England, wrote in an email, adding that as the son of a refugee from Iran he felt the Leave campaign was divisive.

Anxiety about the economy and immigration drove the Leave campaign’s victory. But many young people said they thought the decision would only set back their prospects.

“I’m already part of a generation stuck in rented property unable to buy my own house,” Hannah Shaw, 25, who works at a National Health Service hospital and lives with her parents, wrote in an email. “The older generation seem so happy with the result, almost smug like it’s some sort of victory completely unaware of the chaos they’ve caused for my generation. I’m dreading what will happen to employment, workers’ rights, the environment and our economy.”

She added that she had friends from countries like Slovakia, Poland, Spain and Romania.

“It’s hard to see it affect them and think of the amazing people I’ll never meet after we leave the E.U.,” she said. “The U.K. suddenly feels very small.”

Image

Britons who voted to remain in the E.U. discussed the vote in London on Friday. The referendum exposed a generational divide.CreditAdam Ferguson for The New York Times

Ms. Shaw blamed the news media for spreading misinformation about European Union membership. “A lot of the older generation rely on newspapers for all their facts and don’t actually do any of their own research unlike my generation.”

Jenna Ives-Moody, 19, a journalism student at the University of Huddersfield in northern England, wrote in an email that “serious fact-based journalism within the U.K. is not valued by the majority of the English population.”

She said the Leave campaign was driven by “a misplaced ideal of reclaiming former glories within Britain,” which she said was not common among young people “who embrace all aspects of being European.”

Fear was palpable among the young people in London who have thronged the capital from elsewhere in Europe.

Francisco Vicedo, a 22-year-old Spaniard who works at a branch of the fast-food chain Pret a Manger, is studying for a master’s program on organized crime and terrorism at University College London.

“We’ve already sent money to our countries because we know that in the following days the value of the pound is going to be down,” he said. “Everyone is sending money already.”

He said he hoped to stay in London, where job opportunities are more plentiful than in Spain, but was unsure of his prospects.