Roger Clemens was acquitted Monday of all charges in his lengthy perjury trial, just blocks from where he had been accused of lying to Congress about never having taken performance-enhancing drugs.

The most decorated pitcher in baseball history, whose legacy and Hall of Fame aspirations were seemingly derailed by the accusations of steroid use, wiped away a tear after U.S. District Judge Reggie B. Walton accepted the jury’s unanimous verdict.

Clemens, 49, then hugged his four sons and kissed his wife, Debbie, before hustling from the courtroom to make a brief statement to a battalion of reporters on the steps of the District’s federal courthouse.

“It has been a hard five years. . . . All of you who know me in the media and followed my career, I put a lot of hard work into that career,” he said, sighing and choking back tears.

The verdict was a huge loss for the Justice Department, which was already reeling from the recent acquittal and mistrial of former presidential candidate John Edwards. Last week, the department announced that it would not retry Edwards on the campaign finance charges on which jurors deadlocked.

The Clemens verdict is also the department’s second defeat in a prosecution of a baseball star accused of lying about taking performance-enhancing drugs. Slugger Barry Bonds was convicted last year of a charge of obstruction of justice, but a jury failed to reach a verdict on three other counts accusing him of lying to a grand jury when he testified that he had never knowingly taken the sub­stances. He was later sentenced to house arrest and probation.

Federal prosecutors and FBI agents, who have doggedly pursued the Clemens case since he was referred to them by Congress in 2008, did not flinch as the verdict was read and declined to comment after the proceeding. The District’s U.S. attorney, Ronald C. Machen Jr., issued a brief statement: “The jury has spoken in this matter, and we thank them for their service. We respect the judicial process and the jury’s verdict.” The trial was the second by Machen’s office of Clemens; the first ended in a mistrial last year after prosecutors presented barred evidence to jurors two days into testimony.

Former congressman Tom Davis, the ranking Republican on the committee when it referred Clemens for prosecution, said he didn’t think the Justice Department had to bring the former pitcher to trial.

“Clearly, the Justice Department has had a series of prosecutions against high-profile individuals that have been unsuccessful,” he said, defending the decision of the House Committee on Oversight and Government Reform to refer the case because of what he called “gross discrepancies” in testimony. “We refer a lot of things that don’t get prosecuted,” he said.

The nine-week trial, which included testimony from former teammates, forensics experts, a strength coach and even a housekeeper, ended abruptly: It took jurors just 11 hours to reach a verdict on six felony charges of perjury, obstruction of Congress and making false statements. Clemens, who joined the company of a handful of mostly executive branch officials charged with lying to Congress in recent decades, faced up to 30 years in prison if convicted.

The trial appears to have come down to whether jurors believed Clemens or his chief accuser, Brian McNamee, a former strength coach with a troubled past.

McNamee, who worked with Clemens on the Toronto Blue Jays and New York Yankees and as the pitcher’s employee, told jurors that he injected the seven-time Cy Young Award winner dozens of times in 1998, 2000 and 2001 with either steroids or human growth hormone. The shots, McNamee said, were designed to help the pitcher recover from workouts and improve his longevity.

In February 2008, after his allegations surfaced in a report by former senator George Mitchell about steroid abuse in baseball, McNamee reiterated his claims to congressional investigators and during a nationally televised hearing before the oversight committee. Clemens testified at the same hearing that he has never taken steroids or human-growth hormone.

The committee’s chairman and ranking minority member sided with McNamee and referred Clemens for investigation. Clemens was indicted in 2010. He did not testify at his trial.

During the trial, prosecutors sought to bolster the credibility of McNamee, who admitted to lying or stretching the truth on numerous occasions. They presented physical evidence that McNamee claimed to have collected during his injections of ballplayers. Prosecutors said that McNamee gave them a needle that had traces of Clemens’s DNA and of steroid residue, as well as two cotton balls that contained Clemens’s DNA. The needle and cotton balls were stored in a FedEx box with other medical waste that the strength coach claimed were used on ballplayers, prosecutors said.

Prosecutors also called Andy Pettitte, a teammate and close friend of Clemens’s, to testify. Pettitte told jurors that Clemens confided in him in 1999 or 2000 that he had taken human growth hormone to help him recover from workouts. But on cross-examination, Pettitte agreed with a defense attorney that there was a “50-50” chance he had misheard or misunderstood Clemens.

Jurors declined to comment after the verdict. Michael Volkov, a former federal prosecutor and defense lawyer who has been tracking developments in the case, said jurors typically are unwilling to “nail a high-profile person without a very strong case.”

The verdict suggests, Volkov said, that prosecutors were “unable to sell Brian McNamee to the jury and unable to corroborate any of his information with solid physical evidence or independent testimony.”

Attention will now turn to Clemens’s legacy. If anyone had been all but guaranteed to make the Hall of Fame before the ­steroid allegations surfaced, it would have been Clemens.

Over 24 years with four teams — the Boston Red Sox, the Blue Jays, the Yankees and the Houston Astros, “The Rocket” amassed 354 wins and nearly 4,700 strikeouts in almost 5,000 innings pitched. But then he was accused of taking drugs during baseball’s notorious steroid era, and those chances dimmed. It is not clear how the jury’s verdict will change the perception of his peers and sportswriters, who cast the ballots that decide Hall of Fame entry.

Fay Vincent, a former baseball commissioner, said he did not think that the verdict “will have a great effect on his Hall of Fame chances. It clearly improves them somewhat, but I think the American public and the writers — we saw him testify, and he wasn’t very believable” during his congressional testimony.

“I think there will be a considerable body of writers who will be very skeptical about his achievements,” Vincent added, although, “in the long term, that sentiment may diminish.”

On the steps of the federal courthouse, Clemens’s lead defense attorney, Rusty Hardin, took the opposite view, saying that the former pitching ace “has always said using steroids is cheating and totally contrary to his entire career.” In light of the jury’s decision, Hardin said, skeptics should reconsider their own verdicts.

Staff writers Sari Horwitz and Dave Sheinin and staff researcher Julie Tate contributed to this report.