Chelsea Manning, the former Army private convicted of disclosing classified information, would be challenging Senator Benjamin L. Cardin, the incumbent Democrat up for re-election in November.

WASHINGTON — Chelsea Manning, the former Army private convicted of disclosing classified information, has filed to run for Senate in Maryland, according to federal election filings.

Ms. Manning, who was found guilty of leaking more than 700,000 government files to WikiLeaks in 2013, would face Senator Benjamin L. Cardin in the Democratic primary race this year. Mr. Cardin is Maryland’s senior senator and the top Democrat on the Senate Foreign Relations Committee.

In 2012, the senator cruised to victory in the general election after winning the Democratic primary race with nearly 75 percent of the vote.

Ms. Manning, a transgender woman formerly known as Bradley Manning, received a 35-year prison term for disseminating a vast trove of government documents that included incident reports from the wars in Iraq and Afghanistan and dossiers on detainees being imprisoned without trial at Guantánamo Bay, Cuba.

The sentence was the longest ever imposed in a leak case. President Barack Obama commuted it in the final days of his presidency, calling it “very disproportionate.”

While Ms. Manning, who declined to comment about her election filing, has been hailed as a hero by opponents of government secrecy, others, including President Trump, have called her a traitor to the United States. Since her release, Ms. Manning, 30, has written about free speech, civil liberties, queer and transgender rights and computer security for publications like The Guardian.

Ms. Manning moved to Maryland after leaving the military prison and filed documents with the Federal Election Commission as a Democrat, with paperwork formally processed Thursday.