D.C. Mayor Muriel E. Bowser (D), with infant daughter Miranda, waits to vote at Shepherd Park Elementary School in Northwest Washington on Nov. 6, 2018. (Astrid Riecken/For The Washington Post)

Mayor Muriel E. Bowser (D) became the city’s first chief executive to win reelection in 16 years, but her handpicked candidate failed to unseat one of her rivals in a bitterly contested D.C. Council race.

The mayor’s own reelection had been all but assured since she won the Democratic primary without serious opposition in June. Far more hard-fought was the contest between incumbent council member Elissa Silverman (I-At Large) and challenger Dionne Reeder.

Bowser had thrown her own political clout and donor network behind Reeder, a business executive and third-generation Washingtonian who had campaigned in relative obscurity before the mayor endorsed her in September.

But Silverman — a first-term council member who has advanced progressive legislation while frequently clashing with the mayor and the D.C. business establishment — comfortably survived that onslaught. Incumbent Democrat Anita Bonds captured the second of the two at-large council seats on the ballot.

Silverman’s win was further vindication for the District’s progressives after a number of victories in recent years, most notable being the passage in 2016 of one of the nation’s most generous policies guaranteeing workers paid family and medical leave. Reeder had criticized that law — which Silverman championed — arguing that it directed too much of the city’s money to people who work in the District but live in Maryland or Virginia.

Ron Lester, a pollster who was an adviser to Mayor Marion Barry Jr. and was not aligned with any of the city’s local campaigns, said the at-large council race was “kind of a referendum on whether or not D.C. is going to head in a very progressive direction, like places like Santa Monica, California, and Seattle.”

Silverman’s victory over Reeder, Lester said, was “a signal that D.C. basically wants to continue going down the road that she’s advocated — that the progressive agenda that she’s advocated has strong support.”

In her victory speech at the Tabard Inn near Dupont Circle, Silverman cited her work on the paid-family-leave law and pointed to problems she hoped to tackle in her second term, such as the city’s lack of affordable housing and a persistent achievement gap in the District’s public schools.

“We want to be a compassionate city, a city that ensures workers are paid fairly and equitably. And we want to be a city stronger united than divided,” Silverman said.

In other races, the city’s incumbent elected officials won reelection after a June primary that was decisive for most offices in heavily Democratic Washington.

Bowser, who had no serious opponents in either the primary or general election, is the first mayor to be elected to a second term in office since Anthony A. Williams in 2002. She had won just over 76 percent of the vote with five precincts yet to report.

In a victory speech at Franklin Hall in the U Street corridor, the mayor congratulated Silverman on her win and asked the crowd to give both Silverman and Reeder a round of applause. “Let’s think about the great city of Washington, D.C., and all the things we can do in the next four years,” Bowser said.

Del. Eleanor Holmes Norton (D), the District’s representative to the U.S. Congress, overwhelmingly won reelection, as did Attorney General Karl A. Racine (D), D.C. Council Chairman Phil Mendelson (D) and council members Brianne K. Nadeau (D-Ward 1), Mary M. Cheh (D-Ward 3), Kenyan R. McDuffie (D-Ward 5) and Charles Allen (D-Ward 6).

Also on the ballot were four positions on the D.C. State Board of Education and seats on the city’s Advisory Neighborhood Commissions — local panels that are influential in approving development projects.

Silverman had for a time appeared likewise to have a clear path to reelection. In September, the D.C. Board of Elections kicked the preferred candidate of the city’s business establishment, S. Kathryn Allen, off the ballot because of fraudulent signatures on her petition to qualify for office. At that point, Reeder was still campaigning in relative obscurity.

That changed when Bowser endorsed her shortly after the demise of Allen’s campaign. Virtually overnight, Reeder became a serious threat to Silverman, her message amplified by support from the mayor’s donor network.

Between Oct. 11 and 29 Reeder raised $118,000 to Silverman’s $71,000, campaign-finance records show — nearly a third of it on Oct. 24, when the mayor headlined a fundraiser for her campaign.

Bowser’s efforts were rare for D.C. mayors, who in the past have avoided publicly campaigning against incumbent council members.

At the polls on Tuesday, voters differed in their opinions of the mayor’s last-minute push to oust Silverman. Melvin Frazier, 52, a federal employee and Ward 7 voter, said Bowser’s endorsement was a big factor in his decision to vote for Reeder.

But Susan Campbell, 65, a Cleveland Park resident retired from a career in health policy, said she had been motivated to vote for Silverman because the mayor “went after her.” Campbell said she also voted for Bowser, believing that her three opponents — independent Dustin Canter, Libertarian Martin Moulton and Statehood Green Party candidate Ann Wilcox — were not viable options.

“She hasn’t wowed me, but she’s doing okay,” Campbell said of the mayor.

Bowser’s reelection comes after a first term in which she has avoided serious scandals and presided over an economic boom. Her major policy initiative — replacement of the D.C. General shelter for homeless families with smaller, safer shelters spread across the city — is on its way to completion. Polls have showed her to be broadly popular.

“I think she’s done a good job with the city,” said Robert Bemis, 76, a retired State Department employee and Ward 3 voter. “I think she’s run a largely scandal-free administration, which is important, particularly in this day and age.”

But the District continues to struggle with problems that include gentrification, a scandal-ridden public education system and subpar health care in the predominantly African American neighborhoods east of the Anacostia River. Bowser’s cautious approach to those issues has not always resonated with her constituents.

Ward 3 voter John Young, 50, said he would like to see “more aggressive initiatives” from the mayor’s office and was supporting Bowser without much enthusiasm.

“No one strong was running against her, and she’s not terrible,” he said.

Feelings ran hotter in the at-large council race.

Some voters said Tuesday that Reeder’s attacks on Silverman over paid family leave, which echoed criticisms voiced in the past by the mayor and business groups, had failed to move them. Reeder promised to present a substitute plan last month but did not.

Sarah Graddy, 40, a Bloomingdale resident who works at an environmental nonprofit organization and voted for Silverman, said she took note of Reeder’s failure to offer an alternative to a policy that she so heavily criticized. “I thought that was really ridiculous,” Graddy said.

But while it revolved in part around policy, the contest between Silverman — a white, Jewish woman who has been a champion of progressive legislation and a frequent Bowser antagonist — and Reeder, a third-generation Washingtonian who is black and had the backing of the city’s business establishment, had also become a showcase for larger tensions of race and class in the District.

Reeder and people involved with her campaign mounted sometimes personal attacks on Silverman, saying she was disrespectful toward African Americans and unfairly aggressive in her oversight of programs that benefited black residents in Southeast Washington. Silverman rejected those charges, saying she was a direct communicator and vigilant steward of taxpayer money.

In a city whose black residents have steadily been losing political clout, Reeder’s campaign tapped into deep-seated tensions by portraying Silverman as an outsider. On the eve of the election, the Reeder campaign’s Twitter account posted a graphic that included a grainy, black-and-white image of Silverman and stated that she “was born and raised in Baltimore.”

Marisa Iati, Sommer Brugal, Cindy Choi, Liz Weber and Tyler Blint-Welsh contributed to this report.