Jeffrey Epstein and Robert Kraft, friends of President Donald Trump, are both having a bad week.

A federal judge on Thursday ruled that the Justice Department violated the rights of victims in a non-prosecution agreement with Epstein when he faced charges of abusing dozens of young girls.

The 2008 deal with Epstein was facilitated by Alexander Acosta, the Miami US attorney at the time who now serves as the secretary of the Department of Labor under Trump.

Kraft, who owns the New England Patriots, was charged with two counts of soliciting prostitution on Friday.

Trump has reportedly prioritized issues that were financially beneficial to NFL owners in trade negotiations with Canada at Kraft's request.

Two men with close ties to President Donald Trump, Jeffrey Epstein and Robert Kraft, are at the center of salacious scandals dominating headlines this week.

A federal judge on Thursday ruled that the Justice Department violated the Crime Victims' Rights Act by hiding a non-prosecution agreement with Epstein, 66, in 2008 as he faced allegations of sexually abusing more than 30 underage girls, CNN reported. This is significant for the Trump administration because the deal was facilitated by then-Miami US Attorney Alexander Acosta, who is now Trump's secretary of labor.

Epstein, a billionaire hedge-fund manager, could have faced life in prison. But under the secret agreement with Acosta's office, he pleaded guilty to less serious charges related to prostitution and spent only 13 months behind bars. He also became a registered sex offender and paid settlements to victims.

Read more: Patriots owner Bob Kraft was just charged with soliciting prostitution. Here's how he made his $4.3 billion fortune, from working at his father-in-law's packaging company to buying the NFL team for $172 million

The Department of Justice is accused of violating the law by neglecting to keep Epstein's victims informed on the negotiations surrounding his plea deal.

The secretary of labor has maintained that what transpired was legal and appropriate, but the White House now says it's "looking into" the matter.

Alex Acosta, the secretary of the Department of Labor, facilitated Jeffrey Epstein's non-prosecution agreement when he was the Miami US attorney in 2008. Associated Press

"We're looking into the matter, I'm not aware of any changes on that front," White House press secretary Sarah Huckabee Sanders said when asked whether the ruling has affected the president's views on Acosta.

"My understanding is that's a very complicated case ... but that they made the best possible decision and deal they could have gotten at that time," Sanders added.

Trump is Epstein's neighbor in Palm Beach, Florida, and has flown on his plane, according to The Miami Herald. Other prominent figures, including former President Bill Clinton, also have ties to Epstein.

Read more: Patriots owner Robert Kraft charged with 2 counts of soliciting prostitution

Meanwhile, Kraft, the owner of the Super Bowl champions the New England Patriots, was charged with two counts of soliciting prostitution on Friday.

Kraft, 77, was charged in Jupiter, Florida, with seeking sexual services at Orchids of Asia Day Spa, which has ties to human trafficking, TCPalm.com reported, citing police. There's surveillance footage of Kraft at the facility, according to reports.

A spokesman for Kraft has rejected the allegations in a statement: "We categorically deny that Mr. Kraft engaged in any illegal activity. Because it is a judicial matter, we will not be commenting further."

Kraft routinely visits Trump's Florida resort, Mar-a-Lago, and has a close relationship with the president.

Japanese Prime Minister Shinzo Abe, Donald Trump, Melania Trump, and Kraft at Trump's Mar-a-Lago Club in Palm Beach, Florida, on February 10, 2017. Carlos Barria/Reuters

In 2018, Trump pushed for hard for Canada to renew a regulation that would require Canadian advertisements to be broadcast during the Super Bowl in Canada, even on US television feeds, and did so at Kraft's personal request, the Los Angeles Times reported.

Trump prioritized this matter in trade negotiations with Canada, which pleased NFL owners because of the potential profits from Canadian broadcasting rights, according to the LA Times report.

Trump's efforts in this regard helped squash tensions with NFL owners over his attacks on national-anthem protests, the LA Times reported.

The White House did not immediately respond to a request for comment from INSIDER regarding the president's reaction to the charges Kraft faces.