A federal judge sharply rebuked the National Football League on Thursday as he freed Patriots quarterback Tom Brady from a four-game suspension that had overshadowed his fourth Super Bowl title and hung over his legacy like black bunting.

With the suspension vacated, Brady is poised to lead the Patriots next Thursday night when they commemorate their Super Bowl victory and open the 2015 season against the Pittsburgh Steelers at Gillette Stadium.

But how he reclaims his golden reputation remains in question. The process began with the Patriots tweeting an image of Brady joyfully shouting and pumping his fist during the Super Bowl.

Advertisement

Brady’s status for the season opener had been in doubt until Judge Richard M. Berman overturned Brady’s suspension for allegedly conspiring to improperly underinflate footballs in the AFC Championship Game against the Indianapolis Colts on Jan. 18 and trying to cover up the scheme.

Get Sports Headlines in your inbox:

The most recent sports headlines delivered to your inbox every morning.

But Berman, ruling in the US District Court for the Southern District of New York, cast Brady as the victim of an arbitrary, capricious, and fundamentally unfair disciplinary process administered by the NFL and Goodell.

Berman assailed Goodell for dispensing “his own brand of industrial justice,’’ borrowing the language from a previous court case.

The legal deficiencies included the NFL withholding notice from Brady that his penalty “would be the equivalent of the discipline imposed upon a player who used performance enhancing drugs,” Berman found.

Advertisement

Patriots owner Robert Kraft, who in May was seen as weakening Brady’s defense by accepting a $1 million fine and agreeing to forfeit two draft picks because of the affair, issued a statement praising the franchise quarterback and excoriating NFL personnel.

“With absolutely no evidence of any wrongdoing by Tom in the Wells report, the lawyers at the league still insisted on imposing and defending unwarranted and unprecedented discipline,’’ Kraft said. “Judge Richard Berman understood this, and we are greatly appreciative of his thoughtful decision. Now, we can return our focus to the game on the field.”

Goodell issued a statement disagreeing with the decision and vowing to appeal the ruling “in order to uphold [his] collectively bargained responsibility to protect the integrity of the game.’’

An appeals court is unlikely to resolve the matter before the next Super Bowl, and an NFL spokesman said the league will not seek an emergency stay that would prevent Brady from playing until the appeals court rules.

“The commissioner’s responsibility to secure the competitive fairness of our game is a paramount principle, and the league and our 32 clubs will continue to pursue a path to that end,’’ Goodell said.

Advertisement

DeMaurice Smith, executive director of the NFL Players Association, which represented Brady, hailed the ruling as proof that the league’s collective bargaining agreement does not empower Goodell “to be unfair, arbitrary, and misleading.’’

“We are happy for the victory of the rule of law for our players and our fans,” Smith said.

The saga, which for months has commanded national headlines, unfolded at times like a modern-day knockoff of a Kafka novel about injustice. Acting on threads of circumstantial evidence — provocative but ambiguous text messages between low-level Patriots employees, a team attendant’s mysterious visit to a restroom with Brady’s game balls, Brady’s lengthy phone calls with an assistant equipment manager in the hours after the allegations surfaced, and the quarterback’s destroying his cellphone just before he was to be questioned by investigators — Goodell found Brady guilty of damaging the integrity of a sport that he has helped turn into a $12 billion industry.

Although Brady denied any wrongdoing from the outset, he was not officially exonerated by Berman. The judge indicated he was legally bound by Goodell’s findings as the self-appointed arbitrator in Brady’s administrative appeal of his suspension.

“An arbitrator’s factual findings are generally not open to judicial challenge, and we accept the facts as the arbitrator found them,’’ Berman wrote in his 40-page decision.

The judge concluded, however, that Goodell permitted the process to be spoiled by “several significant legal deficiencies,’’ including informing Brady he could be disciplined under a “competitive integrity policy’’ for league executives rather than a standard for players.

Under the policy for players, Brady’s punishment could have been limited to a fine of only $5,512 if he were found responsible for violating equipment rules for the first time, the judge noted.

Berman, who was appointed to the federal court in 1998 by President Bill Clinton, said Brady was entitled to receive the proper advance notice of the NFL’s list of prohibited conduct and potential penalties. Instead, the judge ruled, Brady found himself wrongly suspended under a policy governing steroid abuse.

In addition, Berman found that the NFL erred in applying an inappropriate standard of culpability in Brady’s case. The Wells Report stated Brady was “generally aware’’ that two Patriots employees — assistant equipment manager John Jastremski and part-time attendant Jim McNally — had allegedly schemed to tamper with Brady’s game balls.

“The court concludes that, as a matter of law, no NFL policy or precedent notifies players they may be disciplined (much less suspended) for general awareness of misconduct by others,’’ the judge stated.

Goodell also was found to have harmed Brady by denying his right to question NFL general counsel Jeff Pash during his arbitration hearing. The NFL refused to make Pash available, saying he had no significant bearing on the Wells Report.

But Berman left little doubt that he considered Pash an active participant in the inquiry, despite Wells’s insistence that he investigated the case independently. Indeed, one of Berman’s footnotes referred to “the Pash/Wells investigation.’’

The judge ruled that Pash logically “would have valuable insight into the course and outcome of the investigation and into the drafting and content of the Wells Report.’’ Berman found that “Goodell’s denial of Brady’s motion to compel the testimony of Mr. Pash was fundamentally unfair and in violation’’ of federal law governing arbitration hearings.

The judge said the NFL also acted unfairly by hiring a member of Wells’s law firm to represent the league in the arbitration case. The move prejudiced the case against Brady by allowing Wells’s firm to act “as both alleged ‘independent’ counsel during the investigation and (perhaps inconsistently) as retained counsel to the NFL during the arbitration,’’ Berman concluded.

His ruling followed several weeks of unsuccessful settlement negotiations between Brady and the NFL.

Had the suspension stood, Brady would have missed the opener against the Steelers as well as games against the Buffalo Bills on Sept. 20, Jacksonville Jaguars on Sept. 27, and Dallas Cowboys on Oct. 11.

The Patriots indefinitely suspended Jastremski and McNally in May after the Wells Report was released. The team has yet to publicly explain the disciplinary action. There was no word from the Patriots Thursday on their future status.

As for Brady, while his national reputation remains stained by the episode, his star continues to burn bright in Boston. Governor Charlie Baker, who recently donned a “Free Brady’’ T-shirt for a public event, celebrated Berman’s ruling by playfully declaring Thursday “Tom Brady Day’’ in Massachusetts.