A US judge has ordered Elon Musk to comply with a subpoena to answer questions from regulators about his purchases of Twitter shares last year.

The order comes after Musk, who beefed up his stake in Twitter -- now called X -- before buying the company for $44 billion, did not show up for a scheduled deposition in September with the Securities and Exchange Commission (SEC), according to a legal filing.

"The court grants the SEC's application to enforce the subpoena," the decision by California judge Laurel Beeler, published on Saturday and seen by AFP, stated.

The billionaire boss and the SEC now have a week to agree on a time and place for Musk to give testimony, it added.

The SEC investigation pertains to all of Musk's purchases of Twitter stock in 2022 as well as his statements and filings with market regulators, court documents stated.

Musk took part in two half-day depositions in July with the SEC, which told the court it has since received "thousands of documents" that have raised questions they want him to answer.

Musk's objections to the latest deposition included an accusation that the SEC is using its power to "harass" him, the commission said in the filing.

"The SEC has already taken Mr. Musk's testimony multiple times in this misguided investigation -- enough is enough," Musk attorney Alex Spiro said in reply to an AFP inquiry.

But the SEC had argued that "Musk's ongoing refusal to comply with the SEC's administrative subpoena is hindering and delaying the SEC staff's investigation to determine whether violations of the federal securities laws have occurred," according to court documents.

Musk's role at the social network has been marked by numerous controversies and led to various legal actions on the part of investors, former employees and companies that had contracts with Twitter.

Shareholders, for example, have filed a lawsuit against Musk, accusing him of disclosing his five percent stake in Twitter too late, after the deadline set by the SEC.