Rep. Chris Van Hollen defeated Rep. Donna F. Edwards in Maryland's heated Democratic Senate primary. Edwards criticized the state party for ignoring women and people of color after her loss. (WUSA9)

Rep. Chris Van Hollen defeated Rep. Donna F. Edwards in Maryland's heated Democratic Senate primary. Edwards criticized the state party for ignoring women and people of color after her loss. (WUSA9)

Rep. Chris Van Hollen won a hard-fought Senate primary that exposed racial and gender divisions within the Maryland Democratic Party, defeating Rep. Donna F. Edwards for the nomination. He will compete in November for a rare open Senate seat, from which Sen. Barbara A. Mikulski (D) is retiring after 30 years.

African American turnout reached record levels, exceeding 2008, when Barack Obama first ran for president, and outnumbering white voters, according to exit polls. Yet the candidate who would have been Maryland’s first black senator and the second black woman to ever serve in the U.S. Senate fell short.

Moments after conceding at a union hall in Prince George’s County, Edwards gave a pointed speech, criticizing her “friends in the state Democratic Party,” which she said is on the verge of “an all-male delegation in a so-called progressive state.” She said Democrats cannot continue to ignore women and people of color.

At a Bethesda Marriott, a crowd of 300 heard Van Hollen praise Edwards “for being a strong advocate for Democratic Party values and priorities.”

Asked about the prospect of Maryland’s first all-male congressional delegation since ­Mikulski’s election in 1986, Van Hollen said he has worked to elect people of all backgrounds and has support from female and African American elected officials.

“Ultimately, people decide who is best to represent all of us,” he said. “I’m going to fight hard as I always have to make sure we address issues that are important to women, families, all of us.”

Van Hollen ultimately won a third of the black electorate, which, combined with his strength among white, wealthier, older and more-educated voters catapulted him to the lead.

In a year when outsiders have captured the national imagination, Maryland Democrats chose the insiders: the deal-making Van Hollen and presidential front-runner Hillary Clinton.

Democratic and Republican voters also cast ballots in primaries for the U.S. House and several local races, including for Baltimore mayor. Former Maryland lieutenant governor Anthony G. Brown edged out his closest primary rival to win the Democratic nomination in Maryland’s 4th Congressional District. Brown will face Republican George E. McDermott in the general election.

But the Democratic fight for the nomination to replace Mikulski was the marquee event of Tuesday’s primary elections. The race was close and contentious for months, as two 57-year-old members of Congress sacrificed safe seats to reach for the Senate and stake a claim to the progressive vote in the heavily Democratic state.

Van Hollen, who built a reputation over two decades in public office as a policy-steeped negotiator and who rose quickly into the House Democratic leadership, ultimately triumphed over Edwards, a black single mother with an activist history but fewer political allies.

[Maryland exit poll results]

1 of 26 Full Screen Autoplay Close Skip Ad × On the ground in Maryland for the primary election View Photos Rep. Chris Van Hollen (D), a U.S. Senate candidate, defeated his challenger Congresswoman Donna Edwards (D). Caption Rep. Chris Van Hollen (D), a U.S. Senate candidate, defeated his challenger, Rep. Donna Edwards (D). April 26, 2016 Election official Jordan K. Johnson heads to open the doors at Eleanor Roosevelt High School in Greenbelt, Md., a polling site. Mark Gail/For The Washington Post Buy Photo Wait 1 second to continue.

Van Hollen vastly outspent his rival, $6.3 million to $2.7 million.

Outside groups helped close that gap: $5 million was spent on behalf of Edwards, compared with $1.6 million on behalf of Van Hollen. But an anti-Van Hollen ad run by the group Working for Us that used video of President Obama may have done Edwards more harm than good by provoking the ire of the White House.

Van Hollen’s campaign took full advantage of the misstep, running ads that conflated the super PAC and Edwards and that made it look as though the president had criticized her. He sent out mailings highlighting his relationship with Obama.

His efforts appeared to have cut into Edwards’s strength with African American voters. Early exit polls showed Van Hollen winning three-quarters of the white Democratic vote, while Edwards was getting roughly two-thirds of the black Democratic vote.

Edwards was also winning among younger voters and those making less than $50,000 a year; Van Hollen did best with seniors and voters with postgraduate degrees.

Although polls across the state closed at 8 p.m., results were held until 9 p.m., because four polling places in Baltimore were ordered by a judge to stay open an extra hour after delays opening Tuesday morning. Edwards had filed an emergency complaint late Tuesday afternoon, seeking the extension.

Van Hollen will face Republican Kathy Szeliga, a state delegate who represents parts of Baltimore and Harford counties, in November. Szeliga won in a large GOP field on Tuesday, but she faces an uphill battle in a state where Democrats outnumber Republicans by 2 to 1.

In recent weeks, the battleground for the Senate seat was concentrated in Prince George’s and Baltimore, home to large communities of African American voters, an important segment of the Democratic coalition.

On Election Day in Baltimore, Van Hollen responded to those who said they want to see a woman or African American representing Maryland in a legislative body with little diversity.

“When I talk to people of all different races and different genders and different backgrounds, they say they are looking for someone with a history of delivering results,” Van Hollen said. “It’s not enough to simply vote a certain way or to provide sound bites. Real work involves forming coalitions to deliver results.”

Edwards has argued that race and gender do matter and that African Americans and women need more representation in the Senate.

“You cannot show up at our churches before Election Day singing the first and last verse of ‘Lift Every Voice’ . . . and call that post-racial and inclusion,” she declared in her concession speech. “When will our voices be effective, equal leaders in a big tent party?”

Edwards’s defiant tone was emblematic of her pugnacious approach to politics, which has won her ardent supporters but has also alienated some of her colleagues.

Voters were torn between the two perspectives.

Victoria Miles, an African American woman from Baltimore, said Edwards impressed her with her story of raising a son alone, facing financial troubles and mounting a successful run for Congress. “You can’t tell nobody anything if you ain’t been through anything,” Miles said.

But Kim Waller, voting in West Baltimore, said she chose Van Hollen because of his role in getting the president’s Affordable Care Act through Congress. The 52-year-old bus driver said the issue was especially important to her because her grandchildren had spent time without health insurance after the death of their mother.

Waller, who is black, said she was put off by Edwards’s focus on electing a black woman to the Senate.

“Why should you put your race in it?” she said.

At Bethesda-Chevy Chase High School in Montgomery County, Erika Dickstein of Bethesda said she voted for Van Hollen. She said she “hated voting against a woman” but thought Van Hollen had been effective in the House.

“He’s done a great job. I actually have a lot of enthusiasm for him,” Dickstein said. “I think he crosses the aisle well, and I think he’s very solutions-

oriented in a Congress that’s not very solutions-oriented. There’s politics of separation now, and I think he’s the exception to that, and that’s good.”

In Prince George’s, several voters at Friendly High School in Fort Washington said they didn’t think Edwards had helped her district. Van Hollen made constituent services a focus of his campaign, saying often on the trail and in ads that he had been more responsive than Edwards.

“I don’t think she was strong enough for the community,” said Erie Rambert, a 72-year-old retired federal worker, adding that Edwards didn’t seem to frequent community events.

Krista Howard said the congresswoman’s office showed no interest in helping when her husband, a federal worker, was injured on the job and required assistance with his compensation.

“She was just not receptive. She did not meet our needs. She didn’t fight for us,” said Howard, a 46-year-old housing counselor who lives in Clinton.

In his victory speech, Van Hollen promised to emulate the beloved Mikulski in that regard.

Mikulski “understood the job of a Maryland senator was, yes, to engage in the big battles on the national level, but she also understood you never forget the people back home,” he said. “I will fight hard for you every day.”

Ovetta Wiggins, Josh Hicks, Fenit Nirappil, Katherine Shaver, Hamil R. Harris, Steve Hendrix, Scott Clement and Arelis R. Hernández contributed to this report.