Convicted leaker Chelsea Manning was soundly defeated Tuesday in her run against longtime Sen. Ben Cardin in the Maryland Democratic primary, ending a longshot bid that attracted widespread media attention when it began in January.

Cardin, 74, triumphed over Manning and six other Democrats, although none was as high-profile as Manning, the former Army intelligence analyst whom President Trump has described as an "ungrateful traitor."

A two-term incumbent and ranking Democrat on the Senate Foreign Relations Committee, Cardin is expected to prevail in the solidly blue state in November. His Republican opponent is yet to be determined.

For Manning, who was arrested in 2010 and convicted in 2013 of leaking a trove of sensitive documents to WikiLeaks, a run for the Senate would have been all but unthinkable years ago.

But Chelsea Manning, formerly known as Bradley Manning, served only seven years of a 35-year sentence, after former President Barack Obama commuted her sentence just before he left office.

After the results were announced Tuesday night, Manning claimed a kind of victory, saying her "campaign platform has advanced an anti-authoritarian agenda."

"Win or lose, our campaign is part of a growing political insurrection," Manning said in the statement. "Our power is real. Our movement is larger than any election, and the political establishment ignores our voices at their own peril."

Manning's rhetoric was incendiary throughout the campaign. In January, she called Immigration and Customs Enforcement "literally the new gestapo." She has called for abolishing both ICE and the presidency itself.

OPINION: IT'S ABSURD TO EVEN THINK ABOUT AWARDING A SENATE SEAT TO A CRIMINAL

In recent weeks, though, Manning seemed resigned to defeat, tweeting: "we can’t expect any change thru the upcoming elections - the primaries are rigged." Her campaign was trailing significantly in the polls, and had raised relatively little money.

In May, a photo on Manning's Twitter account apparently showed the 30-year-old standing on the edge of an upper-story window ledge. The photo was posted to Manning's Twitter account late Sunday with the words: "I'm sorry."

It was sent shortly after a separate tweet that said: "im not really cut out for this world — i tried adapting to this world out here but i failed you — i couldn't do this anymore," among other things. The epsiode caused widespread alarm. A friend later said Manning was OK and needed "some space."

State officials had warned that a computer glitch might cause some problems for voters on Tuesday in Maryland -- although they reassured the public that all votes would eventually be counted.

Voters cast ballots in seven states on Tuesday, including South Carolina, New York, Utah, Colorado, Oklahoma and Mississippi as well as Maryland. With the November general election a little more than four months away, more than half the states will have selected their candidates after the day's final votes are counted.

Fox News' Alex Pappas and The Associated Press contributed to this report.