When Stewart Rhodes, the leader of the Oath Keepers militia, and four other members of the far-right group go on trial on Tuesday for seditious conspiracy in the attack on the Capitol last year, they will join a list of defendants who have faced sedition charges, one that includes Islamic terrorists, Puerto Rican nationalists and radical left-wing unionists.

But Mr. Rhodes and his subordinates intend to offer a novel and risky defense in seeking to rebut the accusations that they plotted to use force against the government: They plan to tell the jury that when armed teams of Oath Keepers prepared to rush into Washington from Virginia on Jan. 6, 2021, they believed they would be following legal orders from the president himself.

Lawyers for the five defendants are set to argue at the trial — which will begin on Tuesday with jury selection — that the Oath Keepers were waiting on Jan. 6 for President Donald J. Trump to invoke the Insurrection Act, a Revolutionary-era law that grants the president wide powers to deploy the military to quell unrest in emergencies.

As the trial in Federal District Court in Washington moves forward, lawyers in the case have said, Mr. Rhodes intends to take the stand himself and testify that even though Mr. Trump never did invoke the act, the Oath Keepers believed that he was going to do so. Their preparations for violence on Jan. 6, he will argue, should be thought of as a lawful attempt to help the president, not as an illegal attack against the United States.

The trial is expected to last four to six weeks, and it is the first of a handful in which far-right groups are facing accusations of anti-government activities. Enrique Tarrio, the former chairman of the Proud Boys, and four other members of the nationalist group are scheduled to face trial in the coming months on seditious conspiracy charges for their own roles in the storming of the Capitol.

For Mr. Rhodes and the Oath Keepers, a legal strategy of allying themselves with Mr. Trump reflects their evolution from a group founded during the Obama administration to oppose what they saw as an overreaching government into one that mobilized to defend presidential power after Mr. Trump assumed the office.

“When the Oath Keepers were founded, the argument they made was relatively simple: The federal government was bad and so-called patriots needed to be ready to resist it,” said Sam Jackson, an expert on right-wing extremist groups who teaches at the State University of New York at Albany. “But that narrative became more complicated when an ally was sitting in the White House.”

In court filings and pretrial hearings, prosecutors have rejected the idea that Mr. Rhodes and his underlings can defeat sedition charges simply by claiming they believed the Insurrection Act would have given them the standing as a militia to employ force of arms in support of Mr. Trump.

As a matter of law, prosecutors say, the act does not allow a president to deputize private armed groups to restore law and order, which the Oath Keepers feared would be lost at the hands of leftist counterprotesters on Jan. 6. The prosecutors have also claimed that Mr. Rhodes invented the Insurrection Act defense well before Jan. 6 to provide a legal fig leaf for his plan to station a heavily armed “quick reaction force” of Oath Keepers in hotel rooms across the Potomac River in Virginia.

Prosecutors point, for instance, to a video meeting on Nov. 9, 2020, when Mr. Rhodes told other members of the group that this armed contingent would “be awaiting the president’s orders.”

“That’s our official position,” he explained. “And the reason why we have to do it that way is because that gives you legal cover.”

The video meeting, recorded and given to the government by a disillusioned member of the group, is just one piece from a trove of evidence that prosecutors plan to introduce at trial to prove that Mr. Rhodes had started planning to oppose Joseph R. Biden Jr.’s ascension to the White House within days of the election.

The government’s presentation will include live testimony from cooperating witnesses from inside the Oath Keepers, recordings of digital walkie-talkies used on Jan. 6 and reams of encrypted Signal chats that Mr. Rhodes and others exchanged in the days leading up to the attack.

Two days after the election, for example, Mr. Rhodes sent a message to several of his members urging them to refuse the results of the voting and warning, “We aren’t getting through this without a civil war.” A few days later, he sent another message to the group, saying that the Oath Keepers had to “march en-mass on the nation’s Capitol.”

Over the next several weeks, prosecutors say, Mr. Rhodes’s four co-defendants joined his plot to stop the lawful transfer of power. They included Kelly Meggs, the leader of the Oath Keepers’ Florida chapter; Kenneth Harrelson, another Florida member; Jessica Watkins, an Ohio bar owner who ran her own militia in the state; and Thomas Caldwell, a former naval officer and F.B.I. employee from Virginia.

Lawyers for the Oath Keepers have repeatedly claimed that the group went to Washington in the days leading up to Jan. 6 not to storm the Capitol, but to provide security at pro-Trump rallies for dignitaries like Roger J. Stone Jr., Mr. Trump’s longtime political adviser, and Ali Alexander, a prominent Stop the Steal organizer who had a permit for an event at the Capitol on the day of the attack.

But prosecutors say that despite their work as bodyguards, members of the group broke into the Capitol during the assault in two separate military “stacks,” with some moving off in search of Speaker Nancy Pelosi. Others, serving with the “quick reaction force,” remained in Virginia, “watching and waiting on the outside,” as Mr. Rhodes had written in a Signal chat that morning, to deal with “worst case scenarios.”

Mr. Rhodes himself never went into the Capitol that day, but remained outside with the group’s top lawyer, Kellye SoRelle, who is facing separate charges in connection with the riot. That evening, after the violence had finally been subdued, Mr. Rhodes continued to encourage his members to the struggle against the new administration.

“Patriots entering their own Capitol to send a message to the traitors is NOTHING to what’s coming,” he wrote.

Prosecutors say that over the next two weeks, as Mr. Biden’s inauguration neared, Mr. Rhodes spent more than $17,000 on weapons, ammunition and military gear. He remained in touch with several members of the group, including one who reached out to him 10 days after the attack to ask about “next steps.”

These efforts to thwart Mr. Biden and to bolster Mr. Trump were a far cry from the Oath Keepers’ initial mission.

Known for his black eye patch — the result of a gun accident — Mr. Rhodes founded the group in 2009, at the height of the Tea Party movement, and specifically recruited former and current law enforcement officers and military veterans who swore an oath to disobey what they considered to be unconstitutional orders from the government.

Throughout President Barack Obama’s time in office, the group inserted itself into prominent conflicts with federal officials. They turned up, for instance, in 2014 at a cattle ranch in Nevada after its owner, Cliven Bundy, and others engaged in an armed standoff with federal land management officials.

But after Mr. Trump was elected, Mr. Rhodes and his members pivoted away from their anti-government views and seemed to embrace the new spirit of nationalism and suspicions of a deep-state conspiracy that had taken root in Mr. Trump’s administration. They also appeared to adopt many of Mr. Trump’s enemies — among them leftist groups such as antifa and the Black Lives Matter movement — as their own.

By the time Mr. Rhodes was arrested one year after the Capitol attack, prosecutors had already charged more than 20 members of the group, effectively dismantling both its leadership and its rank-and-file membership. Two other groups of Oath Keepers are set to be tried in Washington in connection with the Capitol assault — one in November and the other early next year.

Still, Mr. Jackson, who has studied the group for years, said that no matter what happens to the Oath Keepers as a whole, their far-right beliefs and authoritarian views are likely to persist.

“Even if Rhodes is convicted and sent to prison for 20 years, I don’t think that changes the nature of extremism in America,” Mr. Jackson said. “There’s a broader movement in this country that will continue to promote those ideas despite the loss of any one organization.”