A federal judge dealt a potentially fatal blow to the perjury case against baseball legend Roger Clemens by declaring a mistrial just minutes after prosecutors committed a basic error by presenting barred evidence to the jury.

Just two days into the trial, U.S. District Judge Reggie B. Walton in Washington issued his ruling in dramatic fashion from the bench, saying that prosecutors had wrongly played a portion of a video and had ensured that jurors would not be able to “render a fair and impartial” verdict.

“There are rules that we play by and those rules are designed to ensure that both parties receive a fair trial,” Walton told jurors before dismissing them from service. “Evidence that I have excluded from this trial came before you. As a result of that, in my view, the ability of Mr. Clemens with this jury to get a fair trial would be very difficult, if not impossible.”

Walton’s ruling makes it uncertain whether Clemens will ever go back on trial. The judge asked prosecutors to submit legal arguments about whether retrying the 11-time all-star would violate his constitutional protection against double jeopardy. Legal scholars said the decision could go either way.

“It could be close,” said Ellen Podgor, a professor at Stetson University College of Law.

Because the mistrial resulted from prosecutorial error, Walton could choose to dismiss the case. The double-jeopardy protection was established to ensure that defendants are not subjected to endless and unfair prosecutions for the same offense.

But the error occurred early in the trial and defense lawyers didn’t object when the evidence was presented to jurors, factors that benefit prosecutors, legal experts said.

Clemens, who is charged with lying to Congress about using performance-enhancing drugs during his decorated career, was surrounded by reporters and photographers as he departed the District’s federal courthouse.

Clemens declined to comment on the courtroom outcome. Several times, the horde around Clemens stopped as he signed baseballs thrust into his hands by fans.

Citing a judicial gag order, Clemens’s attorneys declined to answer questions, as did federal prosecutors.

The request for a mistrial came from Clemens’s lawyers after prosecutors mistakenly played a portion of congressional testimony that referenced the wife of former pitcher Andy Pettitte, a friend and former teammate of Clemens’s.

Pettitte told congressional investigators that Clemens had confided in him in 1999 or 2000 that he had taken a performance-enhancing substance. Pettitte also told congressional investigators that he told his wife about that conversation. She provided an affidavit to Congress backing her husband’s claims.

Before the trial began, Walton had ruled that prosecutors could not raise Laurie Pettitte’s statements before the jury because it was hearsay and would be unfair to Clemens.

After the ruling, the prosecutors in the case, Steven Durham and Daniel Butler, sat slumped in their chairs, staring at paperwork in front of them. Colleagues and officials close to the prosecutors said the men had made an inadvertent error.

“They are both long-term career prosecutors [with] very solid reputations for integrity,” said Steve Bunnell, a former top-ranking prosecutor in the office who is now a criminal defense attorney. “I would be very surprised if this were anything other than a mistake in their part.”

Even if lawyers persuade Walton to let them retry Clemens, the ruling was a disheartening defeat for the Justice Department and its efforts to prosecute former baseball players whom it has accused of lying about steroid use. In April, the perjury trial of another former baseball superstar, Barry Bonds, ended ambiguously as a jury hung on every count but one that was unrelated to his alleged use of steroids.

Charged with six counts of perjury, obstruction of Congress and making false statements, Clemens is accused of having lied when he testified before a House committee in 2008 that he had never taken performance-enhancing drugs. If convicted on all charges after what was expected to be a month-long trial, Clemens could have faced 30 years in prison, though sentencing guidelines call for 15 to 21 months behind bars.

Walton’s decision Thursday came after two days of trial and four days of intense jury selection that forced more than 50 D.C. residents to the courthouse to answer more than 80 detailed questions about their backgrounds.

It is not known how much the Justice Department has spent on the investigation, which included trips across the country and countless hours questioning witnesses before a grand jury in the District’s federal courthouse. Citing a government exhibit, defense lawyers said more than 100 law enforcement officers and five government lawyers participated in the probe.

Pettitte, one of Clemens’s closest friends and a former teammate on both the Houston Astros and the New York Yankees, was expected to be one of the most important witnesses.

On Thursday, prosecutors began playing video excerpts for jurors of Clemens’s 2008 testimony before the House Committee on Oversight and Government Reform.

During one video clip, Rep. Elijah Cummings (D-Md.) asked Clemens questions about Pettitte’s statements to House investigators. Clemens said he felt that his friend was “a very honest fellow” who misheard what he had told him that day. Clemens said he never told Pettitte that he had used human-growth hormone (HGH) but had instead discussed a TV program that described how “older men” were using it to get “back their quality of life.”

Cummings then asked Clemens about Laura Pettitte’s recollections and began quoting from her affidavit.

Suddenly, Walton ordered a halt to the video and hustled jurors from the courtroom. Clearly irked that prosecutors had violated his order by presenting evidence of Laura Pettitte’s statements, he noted her husband was a critical witness and that the video unfairly bolstered his credibility.

“A first-year law student would know that you can’t bolster the credibility of one witness with clearly inadmissible evidence,” Walton said, adding that prosecutors should have redacted the portions dealing with Laura Pettitte.

Defense lawyers did not escape scrutiny; Walton said they should have objected the moment the tape started rolling. Rusty Hardin, Clemens’s lead defense attorney, first asked Walton to issue an instruction to the jury to disregard the information. Later, when pressed by Walton, Hardin moved for a mistrial.

Walton agreed.

“I don’t see how I can un-ring the bell,” he said.