Elon Musk and Twitter will go to trial over their $44 billion deal in October

Twitter had sought to expedite the case by requesting a trial in September, which Mr. Musk had countered by asking for a trial in February.

Twitter and Elon Musk will go to trial in October over whether the billionaire must complete his $44 billion acquisition of the social media company, a Delaware judge ruled on Tuesday.

The ruling was the first decision in a lawsuit that Twitter filed this month to force Mr. Musk, the world’s richest man, to go through with the blockbuster deal. Mr. Musk had agreed to buy Twitter in April, but indicated this month that he wanted to terminate the purchase. Twitter had sought to expedite the case by requesting a trial in September, which Mr. Musk had countered by asking for a trial in February.

“The longer the merger transaction remains in limbo, the larger a cloud of uncertainty is cast over the company,” said Kathaleen St. J. McCormick, the judge overseeing the case in the Delaware Court of Chancery, in a nearly two-hour hearing.

The ruling was a win for Twitter, which said an extended timeline would give Mr. Musk more time to badger the company and find a way out of the deal. Judge McCormick ruled that the trial would last five days, with the exact date to be based on the schedules of the court and the lawyers in the case.

“We are pleased that the court agreed to expedite this trial,” a Twitter spokesman said.

Alex Spiro, a lawyer representing Mr. Musk, said, “We’ll be ready.”

When Mr. Musk agreed to buy Twitter, he said that he would take it private and that the company had plenty of potential. But within weeks, he began arguing that Twitter had stymied his attempts to understand how many of the accounts on its platform were fake and said the company was not disclosing relevant information to him.

Twitter has said Mr. Musk was searching for a way out of the purchase as the stock market slumped. The company has said it worked with Mr. Musk to give him information about fake accounts.

In the hearing on Tuesday, Twitter pushed for the lawsuit to be resolved as quickly as possible. Bill Savitt, a lawyer for Twitter, said the “continued uncertainty” over the deal “inflicts harm on Twitter, every hour of every day,” and asked that a trial be scheduled in September. Postponements would allow Mr. Musk to run out the clock on financing for the deal, Mr. Savitt said.

Lawyers for Mr. Musk said the billionaire needed more time to analyze extraordinary amounts of data to determine whether Twitter had accurately counted the number of inauthentic accounts on its platform.

Twitter is trying to “shroud” its bot figures, said Andy Rossman, a lawyer for Mr. Musk, “as long as necessary to get this deal railroaded through.”