The excitement of electing the first black woman to serve as speaker of Maryland’s House of Delegates was mixed with a familiar frustration for many African American politicians in Prince George’s County, one of the wealthiest majority-black jurisdictions in the country.

Even as officials there congratulated Del. Adrienne A. Jones of Baltimore County, they said the way in which the Democratic establishment rallied around her Wednesday, instead of Del. Dereck E. Davis of Prince George’s, raised long-simmering questions about the county’s role in state politics and the enduring legacy of racism in Maryland.

Black politicians from Prince George’s were edged out in the past two gubernatorial races, and leaders there had seen Davis’s possible ascension to the powerful speaker’s post as recognition that was long overdue.

“I keep thinking about what my Dad told me as a young professional,” Del. Jay Walker (D-Prince George’s) wrote in a Wednesday Facebook post that was widely circulated among officials in the county. “It sounded like conspiracy theory at the time but today I saw it again firsthand, ‘By the time you learn the rules, they change the rules’ and not to help you out but to help them out!!!”

Prince George’s has the largest share of Democratic voters in deep-blue Maryland and the second-largest share of Democratic members of the House of Delegates. Some of the state’s most powerful politicians grew up in or have roots in the county — including Gov. Larry Hogan (R), Senate President Thomas V. Mike Miller Jr. (D) and U.S. House Majority Leader Steny H. Hoyer (D), all of whom are white.

But none of the black politicians who ascended as the county’s demographics shifted in recent decades have held the governorship, led a chamber of the General Assembly or otherwise reached the top echelons of power. Early this year, a white Democratic legislator from Harford County used a racial slur to describe a Prince George’s legislative district.

Rep. Anthony G. Brown, a former state lawmaker and lieutenant governor who lives in Mitchellville, lost the governor’s race to Hogan in 2014. Former Prince George’s County Executive Rushern L. Baker III lost the gubernatorial primary to Ben Jealous last year.

Then Davis failed to secure the top leadership spot in the House on Wednesday, despite winning the backing of a majority of the Legislative Black Caucus of Maryland and a pledge of support from the 42-member Republican minority.

There were a variety of factors at play in each case, including ideology, personality, geography and race. But the rejection of Davis stung especially hard.

The Democratic caucus was divided between him and Del. Maggie McIntosh (Baltimore City), who is white. They eventually opted for Jones, who had dropped out of the race days earlier in an attempt to build support for Davis.

Her victory made history in the chamber, which for more than four centuries been led by white men. Walker and other leaders from Prince George’s said they were excited to support her. But there were other emotions, too.

“Today was bitter sweet,” Walker wrote in the Facebook post. “I would be lying if I said I wasn’t disappointed.”

Baker pointed out that Hogan, Miller and former House Speaker Michael E. Busch, whose death April 7 triggered the succession fight, have prided themselves on the ability to work across the aisle, a trait for which Davis — a political centrist — was criticized by some left-leaning Democrats.

“It boggles the mind that he was not acceptable,” Baker said. “If you look at their votes, if you look at their temperament, he was the same as Mike Busch. But he is an African American from Prince George’s, and Mike Busch — and I loved Mike Busch — was a white guy from Anne Arundel.”

Davis did not respond to requests for comment.

Miller grew up in Prince George’s but lives in neighboring Calvert County. His district includes parts of both counties, and he has been a strong Prince George’s advocate for decades, including on projects such as the hospital being built in Largo. But the county’s black political establishment still sees him as part of the white power structure.

Council member Derrick Leon Davis (D-District 6), who graduated from the same high school as Davis, said constituents told him at a town hall this week that they “feel again taken for granted by the same Democratic Party for which we deliver mightily.”

Walker, the delegate who wrote the Facebook post, was in a cigar bar in Annapolis this year when a white fellow Democrat, Del. Mary Ann Lisanti (Harford), referred to a district in Prince George’s as a “n----- district.”

Although other legislators also witnessed the slur, it went unaddressed for weeks, until the Black Caucus summoned Lisanti for an explanation. Days later, the House voted to censure Lisanti, who apologized for the remark but also said she had been misunderstood.

In news conferences, late-night phone conversations and visits to Annapolis in recent weeks, Prince George’s officials threw their political weight behind Davis, touting his credentials and history-making potential.

“We do not have in statewide leadership a single Prince Georgian, nor do we have an African American,” County Executive Angela D. Alsobrooks (D) said at a news conference last month, praising Davis as “fair-minded and respected.” She came to Annapolis for Wednesday’s vote, hoping to see her constituent emerge victorious.

Some who supported Davis said they wished he had insisted on a vote on the House floor and tried to win with the support of Republicans. But such a maneuver would have been unprecedented in Maryland. McIntosh and others warned of a rift in the party if a speaker was elected with fewer than half the Democratic votes.

“He would have won it,” Del. Michael Jackson, who chairs the Prince George’s delegation, said of Davis. “I wish he did. I don’t want to see anything fractured. But as far as I’m concerned, nothing would have been fractured.”

Del. Diana Fennell (D-Prince George’s) said she would have liked someone from her county to win the speaker’s race, but she was happy with the history-making outcome and excited for Jones.

“Dereck Davis is a classy guy,” she said. “He was thinking about what is best and moving the agenda forward. You always want to see your own win, but we were elected to do the business of the state of Maryland.”