Elon Musk has consented to testify in the SEC’s inquiry into his acquisition of Twitter in 2022, now rebranded as X, as per a legal document filed with the court.

After seven months of the SEC pursuing legal action to compel his testimony, Musk has agreed to a session lasting up to five hours later this year at an SEC office, according to the court filing. Should an emergency necessitate rescheduling, Musk will require either a court order or written consent from the SEC.

The resolution likely concludes a prolonged dispute between Elon Musk and the SEC over the agency’s pursuit to re-interview the tech billionaire regarding his $44 billion acquisition of X, formerly Twitter.

The SEC’s investigation, outlined in an October 2023 filing in the U.S. District Court for the Northern District of California, focuses on potential violations of U.S. securities laws related to Musk’s purchase of the social media company and his public statements and SEC filings concerning Twitter.

Previously, the SEC accused Musk of abruptly canceling agreed-upon testimony, citing new objections. Musk’s legal team argued that the subpoena was part of what they characterized as repeated and burdensome requests from the SEC investigating Musk and his enterprises.

Musk and the SEC have a history of contentious interactions, notably highlighted by the SEC’s 2018 lawsuit against Musk over tweets about privatizing Tesla, which resulted in a settlement and Musk’s removal as Tesla’s chairman. Recently, the Supreme Court rejected a challenge to the terms of this settlement from Musk’s attorneys.

As of now, an attorney representing Musk has not responded to requests for comment, while the SEC has chosen not to issue any statement on the matter.