A federal judge in San Francisco has dismissed former President Donald Trump’s lawsuit against Twitter that sought to reinstate his banned account on the platform, according to a court filing.

The decision is a victory for Twitter, which had asked Judge James Donato, of the US District Court for the Northern District of California, to toss out the suit.

In throwing out Trump’s case, Donato held that Twitter was not acting as an agent of the US government — as Trump had alleged — when it shut down his account and was therefore not infringing on Trump’s First Amendment rights to free speech.

“The amended complaint does not plausibly allege a First Amendment claim against Twitter,” the decision said. “Plaintiffs’ first claim is dismissed.” “Donato also threw out Trump’s other claims, such as that Section 230 — the law shielding tech platforms from lawsuits over most user-generated content — is unconstitutional.

Twitter declined to comment on the suit’s dismissal.

Trump could continue to pursue the case, with Donato ruling that he can file an amended complaint, though the ruling also states that Trump will not be permitted to add any new legal claims.

Since Trump’s filing of the suit, billionaire Elon Musk has sought to buy Twitter for $44 billion. Musk has said he wants to restore “free speech” to the platform and conservatives believe Trump could be reinstated under Musk’s ownership of the platform. Trump has said he will not return to Twitter even if his account is restored, highlighting his new social media venture, Truth Social.