Updated

The modern highway connecting Brynmawr to other former coal-mining towns in South Wales was partly funded by the European Union, replacing a three-lane road known for deadly accidents. Other EU funds have been used to improve railway lines, open museums and regenerate dreary town centers shattered by the decline of heavy industry.

But none of that impresses John Thompson, a retired truck driver who recalls the days when the area in Blaneau Gwent county was bustling with life, and the coal mines and steelworks provided thousands of jobs.

"We have seen no benefit up here at all," the 70-year-old says outside a cafe serving instant coffee and bacon rolls. Besides, he notes, the EU doesn't just hand out the money: "They tell us how to spend it. That's not democracy."

Even though Wales receives hundreds of millions annually in EU funding, more than half of the Welsh electorate voted in last week's referendum for Britain to leave the EU. Puzzling many analysts, the "leave" vote was strongest in deprived post-industrial areas that have arguably benefited the most from EU support.

"Wales has shot itself in the foot," says Ed Poole, lecturer in politics at Cardiff University. "Wales has been one of the biggest net beneficiaries of being in the European Union."

A study he co-authored before the vote estimated that Wales receives a net annual benefit of 245 million pounds (now $326 million) from the EU budget — 79 pounds ($105) a head. That compares with a net contribution of 151 pounds per head for all of the United Kingdom.

Maybe some voters didn't fully understand the role of EU funds in supporting their communities, Poole says. Maybe, he says, they chose to ignore it. It's not yet clear when the money will go away or what, if anything, might replace it — the negotiations over specifics of Britain's divorce from the EU are expected to take years.

"There may be a sense of disconnect from some of the projects and whether they have a real impact on people's lives," he says. "I do think that this has been an opportunity perhaps to reflect a deep sense of grievance of how the general political processes have been working."

South Wales is a pleasant landscape of lush green hills with small towns in the valleys featuring rows of two-story brick homes that look quaint at first glance but have a certain sadness to them on further inspection. Town centers are quiet, mostly just a few stores and pubs with Welsh flags fluttering in the windows and, here and there, a "vote leave" banner.

Connor Morris, 18, who is in a training program to become a mechanic, said all of his friends voted to leave the EU. He said he's concerned about immigrants, though there aren't many in Brynmawr.

"I don't really know a lot about it. I just voted out," he says, smoking an e-cigarette.

Besides a few factories, there is little work in the towns themselves, so people commute to Cardiff or other big cities. Left in town during the day are mostly older people.

About 80 million pounds in EU funds were used to build the 8-kilometer (5-mile) stretch of highway west of Brynmawr. Signs next to the road remind drivers of where the money came from.

Similar signs in neighboring Ebbw Vale explain the EU's role in building a modern hospital, train station and learning center that now occupy the grounds of the former steelworks that once employed more than 10,000 people.

"Leave" campaigners say many of the EU projects are gimmicky and haven't led to tangible improvements. Also, they consider the EU money to be British money to begin with, since overall Britain contributes more money than it gets back from the EU.

"So people actually used the opportunity of the referendum to say: 'Whoa, stop the car, I want to get out,'" says Welsh Conservative leader Andrew R.T. Davis, who voted for Britain to leave the EU. "The way this car is being driven we're going to hit a brick wall."

The "leave" side's strongest support in Wales was in the low-income county that includes both Brynmawr and Ebbw Vale, where 62 percent voted to quit the EU. By contrast, the Welsh capital of Cardiff voted 60 percent "remain."

In Port Talbot, 57 percent voted "leave" despite warnings from some analysts that losing access to the EU's single market could have devastating consequences for the city's steelworks.

In Pontypridd, a town climbing up misty hillsides north of Cardiff, Jenny Hughes said her education consultancy firm lost three potential contracts the day after the referendum as European partners pulled out. She is furious at neighbors who voted for leaving the EU, and says many of them did so for reasons that have little to do with the bloc.

"You've got the racist brigades. You've got the ones who want Britain to be the way it was. And you have those who are sticking it to the government," she says.

Eddie Cullen, a digger operator in the small town of Hengoad, might belong to the middle category. He says the sense of community was shattered when the town's Penallta coal mine closed in 1991. In its heyday it employed 3,000 people.

Cullen, 59, recalls the noise it used to make: the clatter of drams packed with coal being raised from the shaft. His grandfather worked down there; so did his father.

Now the mine is silent and overgrown with weeds. The shafts have been filled and the winding towers above them are rusting away. The enormous engine hall is gutted, its windows sealed and sprayed with graffiti.

None of that can reasonably be blamed on the EU, and yet when Cullen says people have "had enough" he is directing his frustration at Brussels, not the market forces or British governments that killed off coal mining.

"People just want to be British again," Cullen says, a Jack Russell Terrier pulling on a leash in his hand. "Have their identity back. Not be run by Europe."