Elon Musk has lost a bid to get out of an agreement made with regulators requiring oversight of his tweets about his car firm Tesla.
The settlement was made after he tweeted he had "funding secured" to potentially take Tesla private despite a deal not being close.
The ruling comes just days after the world's richest person struck a deal to buy Twitter for $44bn (£35bn).
Mr Musk says he wants to make Twitter a bastion of free speech.
The Securities and Exchange Commission (SEC) accused Mr Musk of misleading investors with the 2018 tweet, which caused Tesla's share price to fluctuate.
Mr Musk's lawyers argued that the SEC's pursuit of him "crossed the line into harassment" and interfered with his right to free speech.
US District Judge Lewis Liman rejected those arguments as well as Mr Musk's request to stop a separate SEC investigation into tweets he posted last year regarding the sale of some of his Tesla stock.
"Musk cannot now seek to retract the agreement he knowingly and willingly entered by simply bemoaning that he felt like he had to agree to it at the time but now — once the spectre of the litigation is a distant memory and his company has become, in his estimation, all but invincible — wishes that he had not," Mr Liman wrote.
The agreement in 2018 required Mr Musk and Tesla to pay $20m each in civil fines and for him to step down as the chairman of the electric car maker.
It also required Mr Musk to obtain approval from Tesla's lawyers for tweets and other public statements about the company.
The SEC's probe is about tweets Mr Musk posted on 6 November, asking his more than 80m Twitter followers whether he should sell 10% of his stake in Tesla.
A majority of those who voted in the poll said he should sell the stake and Mr Musk has since sold more than $16bn worth of Tesla shares.
Tesla's share price fell in the wake of the poll and the SEC is investigating whether those tweets were cleared by Tesla lawyers before they were posted.
Mr Liman said it was "unsurprising" that the regulator would have questions about the way Mr Musk went about making his decision to sell the shares.
Tesla did not immediately respond to a request for comment from the BBC.
For Twitter to deserve public trust, it must be politically neutral, which effectively means upsetting the far right and the far left equally— Elon Musk (@elonmusk) April 27, 2022
Mr Musk, who is a self-described "free speech absolutist", has called for a shakeup of Twitter's moderation policies, which he sees as a threat to free speech.
Since the board of Twitter agreed to Mr Musk's takeover bid earlier this week, he has posted several tweets about how he wants the social media platform to change under his ownership.
On Wednesday he tweeted "For Twitter to deserve public trust, it must be politically neutral, which effectively means upsetting the far right and the far left equally".