Elon Musk has settled his latest legal fight with the U.S. Securities and Exchange Commission by agreeing to testify for the regulator's probe into his 2022 acquisition of social media site Twitter, according to a Thursday court filing.

Musk and the SEC have agreed on an undisclosed date when the Tesla chief executive will undergo questioning, they said in court papers. Musk also agreed not to appeal the court decision that ordered him to comply with the agency's subpoena.

The SEC sued Musk in October to compel him to testify after he refused to attend a September interview for the investigation. The billionaire said the SEC was trying to "harass" him through unwarranted investigations.

The probe concerns whether Musk broke federal securities laws in 2022 when he bought stock in Twitter, which he later renamed X. It is also reviewing statements and SEC filings he made in relation to the deal, the agency has previously said.

(Reporting by Tom Hals in Wilmington, Delaware and Jody Godoy in New York, Editing by Nick Zieminski)