U.S. Rep. Randy Forbes thanks supporters Tuesday after losing his bid for the Republican nomination for the 2nd Congressional District. (Stephen M. Katz/The Virginian-Pilot via AP)

U.S. Rep. J. Randy Forbes was unseated in a Republican primary Tuesday by a state delegate in a newly drawn Virginia Beach district — a blow to the congressman who switched districts in an effort to remain in Congress.

A court-imposed election map increased the number of Democratic voters in Forbes’s current district, the 4th, making it difficult for him to hold on to the seat. Rather than risk losing to a Democrat, he opted to run in the coastal 2nd District.

But state Del. Scott W. Taylor (Virginia Beach), a 36-year-old former Navy SEAL, successfully painted Forbes as a “carpetbagger” and capitalized in the primary campaign on the same national hunger for an insurgent candidate that helped propel Donald Trump to the GOP presidential nomination.

The district heavily favored the celebrity billionaire in the March 1 primary and will be key to the presidential hopeful’s Virginia campaign.

“There’s a mood in the 2nd District and in the country that Washington is broken,” Taylor said from a packed victory party. “We want something different. We want Washington to work for our veterans, for our families.”

Virginia State Senator and congressional candidate A. Donald McEachin (D-Henrico) speaks during a General Assembly debate in Richmond. (Steve Helber/AP)

Forbes’s loss concludes a 26-year career in public service, starting with the Virginia General Assembly. Forbes, 64, said representing members of the military has been a “high privilege.”

“To each who have stood by us and partnered with us, I am blessed by your friendship and encouragement,” he said in a statement. “We have had a vision for this region, for rebuilding our military, and for defending religious liberty, and while perhaps not embraced by voters tonight, we hope nonetheless [it] will be the path forward for our nation and our region.” Taylor won about 53 percent of the vote to Forbes’s 41 percent, with all precincts reporting, according to unofficial results. A third Republican, lawyer Pat Cardwell, picked up 7 percent.

The coming retirement of Rep. Scott Rigell (R) of the 2nd District and the new congressional map opened the door for Forbes, who adopted the risky strategy of running negative ads against Taylor.

Forbes is “the ultimate outsider running as the ultimate insider,” said Quentin Kidd, a political science professor at Christopher Newport University in Newport News.

Chairman of the House Armed Services’ seapower and projection forces subcommittee, Forbes argued that his influence could protect and increase federal spending in the region. His $1 million war chest dwarfed Taylor’s fundraising.

The new districts also turned the political landscape upside down in the Richmond area, making it possible for two African American Democrats to represent Virginia in Congress for the first time since Reconstruction.

Last year, a three-judge panel decided that the GOP legislature had packed African American voters into the Hampton Roads-based 3rd Congressional District, which is represented by the state’s lone black congressman, Rep. Robert C. “Bobby” Scott.

After the General Assembly missed a deadline for redrawing the map, the court imposed one that unified all of liberal Richmond City into the 4th District, paving the way for a Democrat.

State Sen. Donald A. McEachin (Henrico) defeated Ella Ward, a council member in Chesapeake City, for the Democratic nomination, according to unofficial results.

McEachin said he gained voters’ trust over nearly 20 years in the General Assembly by focusing on the environment, poverty, rural broadband access and infrastructure needs.

“There was a certain comfort and trust level that I could do the same in Washington,” he said.

As for the Republican primary in the 4th District, Henrico Sheriff Mike Wade, an ally of former House majority leader Eric Cantor’s, defeated Jackee Gonzalez for the nomination.

In the sprawling 6th District, which includes Roanoke and Lynchburg, Rep. Bob Goodlatte (R-Va.) easily overcame a rare challenge from a fellow Republican, Harry Griego.

Turnout across the state was low as voters trickled into polling places to cast ballots for congressional races that garner far less attention than statewide or presidential contests.

In Richmond polling places, the new map generated excitement among Democrats who hoped a win by McEachin or Ward could help turn the U.S. House blue in November. Several said they hoped for a Democratic wave in response to Trump’s candidacy.

“Democrats do have a chance at making some gains in both the House and Senate, and this is a good way to make sure we’re there,” said Bruce Gould. “The Trump thing is just going to spin apart.”

Others pointed to the historic nature of a possible win by an African American in a “majority-majority district,” where most voters are white in a city once known as the capital of the Confederacy.

McEachin said the new map rectified an injustice, but he played down the racial implications of the election.“I think that’s a footnote,” he said. A lawyer and chair of the Democratic caucus in the state Senate, he outraised Ward by about 10-1, according to to data compiled by the Virginia Public Access Project.

In Richmond’s Jackson Ward neighborhood, once known as the “Harlem of the South,” the struggles of civil rights pioneers weighed on residents who said they vote in every election.

“My parents were in the civil rights movement. You vote, or you get out of the way,” said Yasmin Crawley, a cardiac telemetry technician.

Asked about the chance of increasing the Virginia delegation’s African American representation, she smiled broadly but quickly turned serious. At a time of police violence against black youths, student loan debt and poverty, “we need heavy hitters,” she said. “We don’t need anybody to be meek and mild or go with the status quo.”