The comparison has become a staple among right-wing figures in the news media and Republican politicians: The attack on the Capitol on Jan. 6 was really no different from the unrest last year that accompanied months of racial justice protests. Any discussion of the first should — out of fairness, they have said — make reference to the second.

Now, for the first time, a federal court is poised to consider the merits of that argument, albeit in a narrow legal context.

The move comes in the case of Garret Miller, a Dallas man charged with storming the Capitol and facing off with officers inside. Last month, Miller, 34, raised what is known as a selective prosecution defense, claiming that he had been charged with violent crimes because of his conservative beliefs, while dozens of leftist activists in Portland, Oregon, had similar charges stemming from last year’s violence reduced or dismissed.

“Mr. Miller has been treated differently by the government than the Portland rioters based upon the politics involved,” his lawyer wrote.

On Thursday, the government rebutted Miller’s claims, suggesting in court papers that a bright line stood between the nationwide protests last summer and the storming of the Capitol. While prosecutors acknowledged that those arrested during weeks of unrest at Portland’s federal courthouse had committed “serious offenses,” they insisted that the suspects in Washington were involved in “a singular and chilling event in U.S. history” that threatened not only the safety of the Capitol but also “democracy itself.”

While selective prosecution defenses rarely succeed, the government’s filing in Miller’s case was an unusual example in which the Justice Department opened a window on its decision-making process in the separate prosecutions.

Miller’s legal argument rests on an analysis of 74 criminal cases stemming from the courthouse attacks in Portland. In nearly 30 of those cases, prosecutors ultimately dropped the charges, according to his lawyer, F. Clinton Broden. In a dozen more cases, defendants were offered a dismissal upon completion of a pretrial diversion program. Three Portland defendants, Broden noted, were allowed by the government to plead guilty to “significantly reduced charges.”

The reason, Broden said, was politics.

“Most, if not all, of the Portland dismissals, offers of pretrial diversion and pleas to significantly reduced charges came after a change from the Republican administration to the Democratic administration running the Department of Justice,” he wrote.

Prosecutors disputed Broden’s calculations as a preliminary matter, arguing that they contained “inaccuracies,” but the government’s filing also sought to make a broader point that there was more at stake in Washington on Jan. 6 than in weeks of turmoil in Portland.

Miller, prosecutors noted, was “part of a mob” that “breached the Capitol building and assaulted law enforcement with the goal of impeding congressional certification of the 2020 presidential election.” The defendants in Portland, they pointed out, never actually broke into the courthouse and never disrupted a proceeding before Congress.

The prosecutors also argued that they have better evidence against Miller — and the hundreds of other rioters charged in connection with Jan. 6 — than they ever managed to obtain against the protesters in Portland.

In the days leading to the Capitol attack, court papers say, Miller posted messages on Facebook talking about a potential civil war and the collapse of the economy and suggesting that he might take firearms to Washington. On the day of the riot, the papers say, surveillance videos show him pushing past officers and entering the Capitol.

Moreover, prosecutors say, in the days that followed the riot, Miller threatened on Twitter to “assassinate” Rep. Alexandria Ocasio-Cortez, D-N.Y.