A US federal court has dismissed two separate anti-trust lawsuits filed against Facebook.
Judge James Boasberg ruled that the Federal Trade Commission (FTC)'s anti-trust complaint against the social networking giant was too vague.
Another separate anti-competition lawsuit filed by a coalition of states was thrown out because the alleged violations occurred too long ago.
Facebook's shares jumped 4.2% to $355.64 on the news.
This resulted in the social networking giant's market value rising above $1tn (£720bn) for the first time ever.
In the US District Court for the District of Columbia ruling, Judge Boasberg wrote that the FTC's complaint was "legally insufficient" and had to be dismissed, because the FTC had "failed to plead enough facts" to back up its claim that Facebook was stifling competition.
The FTC's lawsuit had requested that the technology giant, which also owns Instagram and WhatsApp, be broken up.
"The FTC's complaint says almost nothing concrete on the key question of how much power Facebook actually had, and still has, in a properly defined anti-trust product market," wrote Judge Boasberg.
"It is almost as if the agency expects the court to simply nod to the conventional wisdom that Facebook is a monopolist."
While this is a setback for the FTC that some analysts say could have repercussions for the future of anti-competition law in the US, the watchdog can re-file the charges and has until 28 July to do so.
'Doing nothing over the the last half decade'
Separately, Judge Boasberg also dismissed an anti-competition lawsuit brought by a coalition of 45 US states together with the FTC.
This lawsuit had also sought to force Facebook to divest Instagram and WhatsApp. It related to Facebook's acquisition of the two apps in 2012 and 2014.
In March, Facebook petitioned the federal court in the US to dismiss them, describing the FTC complaint as "nonsensical".
The firm said the FTC's case "ignores the reality of the dynamic, intensely competitive high-tech industry in which Facebook operates".
In his ruling on this case, Judge Boasberg said that the states did not provide "a reasonable justification" for why they had waited between six to eight years to decide to sue Facebook - an argument the social networking giant previously made.
He added that the states had failed to provide "a factual dispute" and only gave a "half-hearted contention that Facebook was not prejudiced but rather 'benefitted from the states not filing sooner', since it has been and remains a very profitable company".
"Ultimately, this anti-trust action is premised on public, high-profile conduct, nearly all of which occurred over six years ago - before the launch of the Apple Watch or Alexa or Periscope, when Kevin Durant still played for the Oklahoma City Thunder and when Ebola was the virus dominating headlines," wrote Judge Boasberg.
He added that the states' allegations made it clear that the lawsuit could easily have been filed between 2012 and 2014: "The system of anti-trust enforcement that Congress has established does not exempt plaintiffs here from 'the consequences of [their] choice' to do nothing over the last half decade. "
BBC