Elon Musk has threatened to walk away from his $44bn takeover of Twitter, accusing the social media company of “thwarting” his requests to learn more about its user base.

In a letter filed with regulators, Mr Musk said he was entitled to do his own measurement of spam accounts.

The letter formalises a dispute that has simmered for weeks after Mr Musk declared the deal “on hold” pending further information.

Twitter has defended its estimates.

But Mr Musk has said he believes spam and fake accounts represent a far greater share than the less than 5% of daily users that Twitter reports publicly.

“As Twitter’s prospective owner, Mr Musk is clearly entitled to the requested data to enable him to prepare for transitioning Twitter’s business to his ownership and to facilitate his transaction financing. To do both, he must have a complete and accurate understanding of the very core of Twitter’s business model – its active user base,” lawyer Mike Ringler wrote in the letter.

“Based on Twitter’s behaviour to date, and the company’s latest correspondence in particular, Mr Musk believes the company is actively resisting and thwarting his information rights,” the letter said.

“This is a clear material breach of Twitter’s obligations under the merger agreement and Mr Musk reserves all rights resulting therefrom, including his right not to consummate the transaction and his right to terminate the merger agreement.”

The dispute has raised more doubts about the future of the takeover, which Twitter’s board approved in April.

“Twitter has and will continue to cooperatively share information with Musk to consummate the transaction in accordance with the terms of the merger agreement,” the company said in a statement.

Twitter, which has said Mr Musk waived typical rights to due diligence in his eagerness to clinch the deal, added that it intended to complete the takeover at the agreed price and terms.

Mr Musk, who faces a $1bn break-up fee and possible lawsuit if he opts out, first raised the issue of the spam accounts on social media last month, saying the deal was on hold but he remained committed to the acquisition.

Analysts have said the Tesla boss might be using the issue to try to renegotiate the price or even walk away. They said Mr Musk’s decision to raise the issue on social media was unconventional, making it difficult to establish how serious he was.

When Twitter chief executive Parag Agrawal defended the company’s process in a series of tweets, Mr Musk responded with a poo emoji.

Mr Musk has said he believes that bots could account for 20% or more of Twitter users. The letter, filed with the US Securities and Exchange Commission, confirms that the two sides have gone back and forth on the issue since early May.

It says Mr Musk merits “reasonable cooperation” as he tries to line up financing for the deal.

“Twitter’s latest offer to simply provide additional details regarding the company’s own testing methodologies, whether through written materials or verbal explanations, is tantamount to refusing Mr Musk’s data requests,” the letter says.

“Twitter’s effort to characterise it otherwise is merely an attempt to obfuscate and confuse the issue.”

Texas attorney general Ken Paxton entered the debate on Monday, saying he had launched an investigation into Twitter for “potentially false reporting over its fake bot accounts”. Twitter has until 27 June to respond to his request for information.

Mr Musk’s plans for the company have drawn intense scrutiny from regulators around the world, while raising some alarm among investors of electric car company Tesla and rocket firm SpaceX, which Mr Musk also leads.

He has lined up outside investors to help pay for the takeover and is also using equity and loans backed by his Tesla shares, which have been hit in recent weeks as market turmoil wipes billions from the values of companies including Tesla.

The decline has also made Mr Musk’s offer of $54.20 per share for Twitter look even more generous. On Monday, Twitter shares were trading below $39, down 3%, though they later regained some ground. They have yet to return to the highs they hit last month shortly after Mr Musk revealed he had purchased about 9% of the firm’s shares.

Susannah Streeter, senior investment and markets analyst at Hargreaves Lansdown, said the letter marked the “strongest signal yet that the Tesla founder is prepared to walk away”.

“This is a move Twitter investors have for weeks been steeling themselves for: the moment when Elon Musk’s haphazard ruminations in tweets have been distilled into an official letter to regulators,” she said. “However, given the added volatility which has hit the tech sector since Mr Musk made his offer, it’s highly likely he’s after a cheaper price even if Twitter does provide the data requested in support of its initial analysis.”