BALTIMORE — Kweisi Mfume won the Democratic primary to succeed the late congressman Elijah E. Cummings, defeating the revered lawmaker's widow and positioning himself to reclaim the deep-blue seat he held more than 20 years ago.

Known by his supporters as an elder statesman with the gravitas to continue Cummings’s work, Mfume, 71, campaigned as a civil rights leader who could stand in opposition to President Trump and act as the moral conscience of the House on health care and criminal justice reform.

The former NAACP chief captured a strong plurality of the vote in a field of two dozen Democratic hopefuls, according to unofficial results, easily besting Maya Rockeymoore Cummings, former head of the state Democratic Party; and state Sen. Jill P. Carter (Baltimore City), a former public defender, each of whom were far ahead of the rest of the field.

“I accept your nomination as the Democratic nominee to Congress!” said Mfume, smiling broadly onstage and surrounded by supporters. “Experience matters.”

He thanked Cummings’s sisters, who endorsed his campaign, and waved to them in the crowd. “This is for him. This is for him!” he said of his friend of 42 years.

The winner of the Republican primary was Kimberly Klacik, whose video of trash in West Baltimore last summer prompted Trump to call Cummings’s district a “disgusting, rat and rodent infested mess.”

In a district where Democrats far outnumber Republicans, Mfume will be favored to win the April 28 special election to serve out the rest of Cummings’s term. Former members who return to Congress typically regain their seniority, but the decision is up to House Democrats.

After casting her vote in Baltimore, Sharon E. Watts, 72, a retired educator, said Mfume comes closest to capturing the tenacity that Cummings, who died in October, famously showed in office.

“At this time we don’t need any folks going into Washington, D.C., new at the job,” she said. “We need someone who can somewhat step the way that Elijah was stepping. Everybody has their own style, of course. Kweisi has proven himself in many ways politically. . . . There are no perfect politicians, period.”

The nominees will compete in a special general election on April 28, the day of the 2020 Maryland primary, when turnout should be much higher.

They and the other candidates in Tuesday’s election are registered to run in the April 28 primary contest, the winners of which will compete in November for a full two-year congressional term.

The General Assembly has passed a bill, which Gov. Larry Hogan (R) signed Monday, that allows candidates to withdraw from the April 28 primary by Thursday. But both Carter and Rockeymoore Cummings made clear they would stay in the race.

“I’m looking forward to April 28, and I look forward to working with all of you all to make it happen,” Rockeymoore Cummings said as supporters chanted her first name. “I look forward to what comes next.”

Mfume, who left Congress in 1996 to head the NAACP, faced criticism during the campaign about his vote for the 1994 crime bill, which has been blamed for high rates of incarceration.

His up-from-the-streets life story is part of his political persona. After losing his mother to cancer as a teenager, Mfume dropped out of high school, joined a gang and was arrested multiple times. He says his mother’s memory inspired him to go back to school, then advance to college and eventually seek public office. He served on the Baltimore City Council before succeeding his mentor, Parren Mitchell, the first African American elected to Congress from Maryland, in the 7th District.

The 7th District is anchored in West Baltimore and stretches into Baltimore and Howard counties. The Democratic primary campaign focused heavily on how to help Baltimore, with the major candidates offering plans for violence prevention and intervention, more money for law enforcement, job creation, and keeping mentally ill people out of prisons.

Klacik, the Republican nominee, said she, too, was trying to help Baltimore by posting the video, which she said brought necessary attention to conditions in the city. She describes herself as a college dropout who competed in beauty pageants and set up a nonprofit to help disadvantaged women.

Rockeymoore Cummings tried during the campaign to overcome a reputation as an outsider in a city that was deeply and closely identified with her late husband. She faced questions about Democratic Party spending while she was in charge and about sloppy accounting and questionable tax filings by her policy consulting firm and a related nonprofit she also heads.

Mfume’s departure from the NAACP, where he was president from 1996 to 2004, also came under scrutiny, with the Baltimore Sun reporting last month that the organization’s executive committee was dissatisfied with key aspects of his performance. Mfume also faced allegations of workplace discrimination, with an outside attorney hired by the NAACP finding that the employee who made the claim could have a credible case.

At Gwynns Falls Elementary School in Baltimore, many voters were retirees, such as Christine Speight, 71, who said she chose Mfume on the strength of his experience.

“The last time he was in there, he did a pretty good job,” she said, adding that allegations about Mfume’s tenure at the NAACP didn’t deter her because they are from years ago and nothing new has surfaced.

Speight said her top concern is the crime rate, followed by the need for affordable housing.

Teara Fisher, 34, a homemaker, voted for Rockeymoore Cummings because she wants to see a woman representing Maryland in Congress and respects the Democrat’s policy chops.

“Especially this [older] demographic, they only go with what they know,” Fisher said. “Kweisi has some knowledge, but that was from the ’90s. We have changed. Maya is going to be a little bit more progressive. . . . Fresh ideas is where we need to go.”

The Maryland State and District of Columbia AFL-CIO endorsed Mfume. Emily’s List, which endorses Democratic women who favor abortion rights, backed Rockeymoore Cummings, noting that there are no women representing Maryland in Congress.

Carter, a liberal who supports Medicare-for-all, had the support of Ben Jealous, the 2018 Democratic nominee for governor, and Our Revolution, a nonprofit political organization founded by presidential hopeful Sen. Bernie Sanders (I-Vt.). She was endorsed by the Baltimore Sun over the weekend.

Mfume raised the most money of all the candidates as of mid-January, with $266,098, followed by community activist Saafir Rabb with $217,273, and Rockeymoore Cummings with $208,008. Michael Higginbotham, a longtime professor at the University of Baltimore School of Law, raised $109,677 and loaned his campaign about $500,000.

Carter raised $54,219, the filings state. State Dels. Talmadge Branch (D-Baltimore City) and Terri L. Hill (D-Howard), proven vote-getters who also are running, raised $57,515 and $49,193, respectively.

Some notable donors to Mfume included NAACP board member Hazel Dukes of New York, Baltimore attorney Billy Murphy and David Wilson, president of Morgan State University, where Mfume is chairman of the Board of Regents.

Rockeymoore Cummings collected donations from Democratic strategist Donna Brazile, longtime activist and former state party chair Terry Lierman, entertainer Rosie O’Donnell and April McClain-Delaney, the wife of former Maryland congressman John Delaney.

Paul Robinson, 63, a retiree, said he voted for Mfume because he has known the man all his life and watched his career flourish.

“He’s the only one that can stand up to what’s going on in Washington, D.C.,” Robinson said. “I’m not happy with the president and the Congress as it stands.”

Erin Cox contributed to this report.