What has propelled the rise of the outspoken rabble-rousing billionaire, Donald Trump? I went to Bakersfield, a hardcore Republican enclave in the otherwise liberal state of California, to find out.

"If you go to the Mexican neighbourhoods where a lot of illegals are," said David Rogers, a white IT expert who lives here, "they're all dirty. I don't want to hang around people that throw trash out on the street."

Mr Rogers was born in Bakersfield in 1946, when it was a largely white town. Now, about half the population is Hispanic or black. Mr Rogers, like many of Mr Trump's supporters I met here, believes crime levels and drugs problems in his town are largely due to the influx of immigrants.

The United States is in the throes of a historical wave of immigration that began in the 1960s. Fifty-nine million immigrants, many Mexican, have changed the face of America. Mr Trump's supporters, like Mr Rogers, say they do not object to immigrants as a whole. They say it's just the estimated 11 million illegal immigrants they resent.

Donald Trump is promising to "put America first", with sweeping pledges to deport illegal immigrants, negotiate better trade deals for America, and make the United States great again.

Image caption David Rogers with Hilary Andersson at a Trump rally in Fresno, California

On a hot Sunday evening, Mr Rogers invited friends over for a barbecue. The discussion turned to Mr Trump's proposal to build a wall along America's entire 2,000-mile (3,200km) border with Mexico, to keep out illegal immigrants.

"You've got to have a boundary if you're going to have a country," said Mr Rogers. "What they should do is they should shoot them as they get to the top and if they fall over on the Mexican side then we're in the clear," said Mr Roger's son, Alex.

As Mr Trump's campaign gains steam, the presidential hopeful is attracting a broader base of supporters. Not all have views as extreme as Mr Rogers and his friends.

But here in Bakersfield, there is a lot of support, not just for Mr Trump's plan to build a border wall, but also his more radical proposal to deport 11 million illegal immigrants.

"When Mexico sends its people, they're not sending their best," Mr Trump said last summer. "They're bringing crime. They're rapists. And some, I assume, are good people."

Image caption The collapse in the price of oil has hit Bakersfield hard

Many of Mr Rogers's neighbours now are Hispanics. "All these people are hard workers," said Roxi Mankel, who lives across the street from him. "How can somebody get so much support with so much hate?"

The answer, locally at least, is that many feel immigrants are taking scarce jobs. And times are hard in Bakersfield nowadays.

On a street corner in the rough part of town called Oildale, an exhausted looking woman sat on her front porch with a motley collection of old furniture, pots and clothes for sale out on her lawn.

"Everybody's been laid off," said Shari Kent, who was selling her possessions to try to make money. "People have got to eat," she added. Bakersfield is dotted with oil rigs, stretching as far as the eye can see. Many are idle. The global collapse in oil prices has hit this oil town hard. Ms Kent has had her hours cut at the local grocer's shop because there are now so few customers.

"Hispanics will work for less money, you know," Ms Kent's neighbour Ramona told me. "They can undercut the price."

America's illegal immigrants make up a workforce of an estimated eight million people that helps to drive America's economy.

Bakersfield has a long history of racial tension. In Oildale, where Ms Kent lives, you were not welcome after dark when Mr Rogers was a youth, unless you were white. "No blacks across that bridge after dark," said Mr Rogers. He and his friends used to throw things at black people to hound them out.

Image caption There were protests at Trump's Fresno rally

It's not so different now. Walking along a backstreet, we passed a garage with a swastika on the wall. Locals say white white gangs roam the streets, and that there are often street fights between African American and white youths.

In some ways Mr Rogers has adapted to the changing face of his town. He has Mexican friends. One night when we were with him, he arranged food for a sick Mexican neighbour. He says it's not about race. But he supports Mr Trump's call for a temporary ban on Muslims entering the US, saying American lives are the most important.

"Muslims... have a certain look, and I just feel like, OK, I don't like that person,' you know," he told me. "If we save one person's life, [an] American's life, it's worth stopping everybody from coming in."

Many Americans never expected Donald Trump's presidential bid to make it this far. Some Republicans have disavowed him completely, because of his hard-line proposals. Others hope he will tone his message down.

It's a message that appears to have tapped into a groundswell of anger, resentment and racial tension.

"I think Donald Trump opened up Pandora's Box to what's been hidden, with all the racism and hatred that's been in the United States," said Roxi Mankel.

Dealing with what comes out of that box may yet decide the outcome of this November's presidential contest.

Panorama: Trump's Angry America can be seen on the weekend of July 23 and 24 on BBC World News at these times. It was first shown in the UK on BBC One on 18 July and is available via BBC iPlayer (UK only).