Robert Kraft was one of 25 men charged with solicitation after police secretly installed cameras at a massage parlor. (Kathy Willens)

A circuit court judge ruled Tuesday that video of New England Patriots owner Robert Kraft allegedly engaging in illegal sexual activity at a Florida spa would be temporarily kept from the public. The judge cited Kraft’s “right to a fair trial” but added that the video would only be withheld from media requests for “a limited duration,” depending on how the owner’s legal proceedings progress.

Lawyers for Kraft, who authorities said was recorded paying for sex on two January days at a massage parlor in Jupiter, Fla., asked the court for a protective order against the release of the video, claiming in part their client’s right to privacy and an exemption under a Florida statute related to active criminal investigations.

However, Judge Leonard Hanser of the 15th Judicial Circuit in Palm Beach County found the lawyers’ arguments to that effect neither “legally [nor] factually sufficient.” In a 10-page ruling, though, Hanser agreed that “making these images public, at this time, seriously jeopardizes [Kraft’s] fundamental right to a fair and impartial jury.”

Saying that he was risking “hyperbole,” given that the underlying charges are misdemeanors, to which Kraft has pleaded not guilty, Hanser wrote that the case placed “in sharp contest issues fundamental to society.” He ruled that, in this instance, “the right of the public to be fully informed, through the media’s First Amendment rights,” was trumped by “the right of a defendant to a fair trial, guaranteed through the Sixth Amendment.”

Florida’s Supreme Court, the judge noted, has “adopted the principle that the right to a fair trial is the most fundamental of all freedoms and must be preserved at all costs.”

In a separate hearing Tuesday, another circuit court judge ruled that attorneys for the spa owner and an employee could subpoena a gossip website to ask about its report that it was approached with leaked video of Kraft. Officials from the Jupiter police department and the Palm Beach County state attorney’s office denied that either intentionally caused the leak, as argued by the attorneys.

That judge, Joseph Marx, claimed (via USA Today) that if the video “has really been leaked, people are going to see it.” He added, “Somebody is going to buy it. I don’t think there’s anything I can do to stop that.”

Hanser, noting that “these videotapes are not being sought for the purpose of seeking the public’s assistance to identify and apprehend a perpetrator,” wrote, “In effect, the potential jury pool would be given the opportunity to preview trial evidence, including identifying [Kraft] as the person depicted in the video tapes."

However, he asserted that “the delay in disclosing the videotapes to the media must be limited only to such duration as necessary to avoid tainting the jury pool.” Once a jury is sworn in, a plea agreement is reached, prosecutors drop the case or “at any other time at which the Court finds the fair trial rights of [Kraft] are not at risk,” the video could be released, although the owner’s lawyers are still working to suppress it.

The judge made clear at the outset of his ruling that the celebrity of the 77-year-old Kraft, whose Patriots have won the Super Bowl six times in 10 appearances since he bought the team in 1994, was a major factor in his decision. Ordinarily, he wrote, a case involving an older man who “allegedly engages in illegal sexual activity” would be “a rather tawdry but fairly unremarkable event.”

“But if that man is the owner of the most successful franchise in, arguably, the most popular professional sport in the United States, an entirely different dynamic arises,” Hanser declared, “especially if the encounter is captured on videotape, and the incident is the focus of much media attention and pretrial publicity.”

Read more from The Post:

25 years ago, the Redskins picked the wrong QB. Heath Shuler is fine, but the team isn’t.

Frank Clark trade to Chiefs could shake up 2019 NFL draft

2019 NFL draft: Ranking the top 50 prospects