A federal magistrate judge in Miami has ordered President Donald Trump to answer questions under oath in his defamation lawsuit against the BBC by 11 December, ending a dispute over whether the president would sit for a deposition in his own case.

Judge Enjoliqué Lett issued the order from the bench on Thursday, according to the BBC and The Hollywood Reporter. She said Trump must give the deposition by that date or face sanctions, the most serious of which could be the dismissal of the lawsuit, unless the period in which both sides gather evidence is extended.

The case is still at the discovery stage, when lawyers exchange documents and other material that may become evidence. Charles Tobin, a lawyer for the BBC, told the court that with about two months left in that period the broadcaster had still not been able to question the plaintiff.

Trump had been due to sit for the deposition on 16 October but cancelled it, citing what his team called matters of national importance. Tobin told the judge that the president was in fact campaigning in Georgia that day and had put that ahead of answering the BBC's questions. The BBC reported that Trump attended a midterms rally in Dalton, Georgia, and a fundraiser at his Mar-a-Lago club in Florida.

In a filing this week, Trump's lawyers said he could be available between 11 and 22 January next year and argued that the BBC was wrong to claim he was avoiding the deposition. The judge's order sets a deadline well before that window.

The lawsuit, filed in the Southern District of Florida last December, accuses the BBC of defaming Trump in an episode of its Panorama programme, "Trump: A Second Chance". The 33-page complaint alleges what it calls a false, defamatory, deceptive, disparaging, inflammatory and malicious depiction of the president.

At the centre of the case is the editing of a speech Trump gave outside the White House on 6 January 2021, before his supporters stormed the US Capitol. In the original speech, Trump said: "We're going to walk down to the Capitol, and we're going to cheer on our brave senators and congressmen and women." The Panorama edit showed him saying: "We're going to walk down to the Capitol ... and I'll be there with you. And we fight. We fight like hell." The two clips were recorded more than 50 minutes apart.

The BBC has acknowledged the splicing, apologised and said the broadcast gave the mistaken impression that Trump made a direct call for violent action. Its director-general and its head of news later resigned. The broadcaster has nevertheless denied that it defamed Trump, saying in a statement when the suit was filed: "While the BBC sincerely regrets the manner in which the video clip was edited, we strongly disagree [that] there is a basis for a defamation claim."

The dispute has also drawn in the editing process itself. A leaked memo from an independent adviser, Michael Prescott, concluded that the documentary "seemed to be taking a distinctly anti-Trump stance", a finding that intensified criticism of the broadcaster's standards.

The BBC has argued that the programme does not meet the legal test for defamation and was not available in the United States. In July, Trump's lawyers conceded they had no evidence that it had been shown on the BBC's BritBox subscription service, on the BBC website, on BBC Select or through US broadcasters, as they had originally claimed. Trump later agreed to drop his case against BBC Studios, the corporation's commercial arm, after the BBC said it had no role in making the programme.

Trump's legal team has also sought to limit what the broadcaster can obtain. The BBC wants records that it says are needed to test the president's claim that his reputation was damaged; Trump's lawyers have called some requests too broad.

Several questions remain open. The first is whether Trump will appear by 11 December or seek another extension, and whether the judge overseeing the case would grant one. The second is what the deposition will produce: a sitting president answering sworn questions about his own speech, his state of mind and the harm he says he suffered is unusual in any defamation case.

The third is timing. Discovery is due to finish in the coming weeks, and no trial date has been set. If Trump does not sit for the deposition, the BBC can ask the court for sanctions, and the judge has already indicated that dismissal of the suit is among the possible outcomes. If he does appear, his answers will shape both sides' arguments over whether the edited programme caused the damage he alleges.

For now, the order changes the immediate pressure on the White House: a legal deadline in a case Trump brought himself, in a court in his home state, over a British broadcaster's edit of words he spoke five years ago.