Two Virginia police officers accused of making off-duty appearances at the U.S. Capitol on Jan. 6 were ordered to give up their firearms by a federal judge Tuesday.

Officer Jacob Fracker and Sgt. Thomas Robertson, of Rocky Mount, Va., are both accused of trespassing at the Capitol and taking part in the riot. Their department placed each of them on administrative leave.

Government prosecutors did not seek to detain either of the men but did ask that their travel be restricted and that they not be allowed to possess any firearms during a virtual hearing. The judge agreed and restricted both men from possessing firearms or traveling outside of Virginia.

VIRGINIA OFF-DUTY COPS WHO SNAPPED SELFIE INSIDE CAPITOL CHARGED

A government prosecutor said numerous weapons were recently found at Mr. Robertson's home, against a court order. The government also claimed that both men have called for an insurrection online.

The officers are also accused of making inflammatory social media posts in which they allegedly bragged about taking part in the riot.

"CNN and the Left are just mad because we actually attacked the government who is the problem and not some random small business," Robertson allegedly wrote in one of the posts, according to a criminal complaint. "The right IN ONE DAY took the f----- U.S. Capitol. Keep poking us."

Police officers Jacob Fracker and Thomas Robertson took a selfie inside the U.S. Capitol during an insurrection. Fracker is a member of the National Guard, the Army said Friday. (U.S. DISTRICT COURT)

They also allegedly posed for a photo from inside the Capitol in which one of them appears to be making an obscene gesture in front of a statue of Revolutionary War hero John Stark. Stark, of New Hampshire, is credited with coining the state’s motto, "Live free or die."

However, in an interview with the Roanoke Times, a Virginia newspaper, Robertson condemned the violence as "absolutely ridiculous."

TWO VIRGINIA POLICE OFFICERS ON LEAVE, FACE REVIEW AFTER SELFIE SURFACES FROM INSIDE CAPITOL

And Fracker, a Marine veteran and National Guardsman who said he served in Afghanistan, told the paper that he’d dedicated his "entire adult life" to public service protecting other Americans.

"I’ve never once cared about skin color, religion, political views, sexual orientation or anything. Americans are Americans, we bleed the same," he was quoted as saying. "I have fought against terrorists who threatened our way of life. I’ve put away drug dealers who would have seen to our children getting addicted to their product just so they could make a buck."

Yet, according to investigators, Robertson said he was proud of the photo in an Instagram post.

"It shows 2 men willing to actually put skin in the game and stand up for their rights," he allegedly wrote in a comment included in the criminal complaint. "If you are too much of a coward to risk arrest, being fired, and actual gunfire to secure your rights…you have no words to speak I value."

Both officers face charges of knowingly entering or remaining in a restricted building or grounds without lawful authority and violent entry and disorderly conduct on Capitol grounds. They were released on bond apiece last week under conditions that included staying out of Washington unless they’re due back in connection with their case.

Their next court date was set for Feb. 2 at 3 p.m.

CLICK HERE TO GET THE FOX NEWS APP

Fox News’ Danielle Wallace and the Associated Press contributed to this report.