A U.S. Capitol Police officer has been charged with obstructing justice in the Jan. 6 Capitol breach investigation after allegedly telling a riot participant to erase self-incriminating Facebook posts and then deleting his own messages with the man, according to charging papers.

Officer Michael Angelo Riley, a 25-year force veteran and canine officer, was charged Thursday by indictment with two counts of obstructing justice, punishable by up to 20 years in prison.

At an appearance Friday afternoon in federal court, Riley was released on personal recognizance on the condition he not contact certain people to be named by prosecutors. Riley, represented by defense attorney David Benowitz, did not enter a plea and was set for a next appearance on or before Oct. 26.

Attempts to reach Riley, 50, or his relatives were not immediately successful. Benowitz did not immediately respond to a request for comment.

“Obstruction of Justice is a very serious allegation,” U.S. Capitol Police Chief Tom Manger said in a statement. Manger said the force was notified several weeks ago about the investigation and that upon arrest Thursday, Riley had been placed on administrative leave pending completion of the case, after which he would be subject to internal investigation.

In a statement, the chairman of the union representing Capitol Police officers, Gus Papathanasiou, urged people to allow the judicial process to proceed “before rendering a judgement on this officer.”

According to the indictment, Riley was not inside the Capitol but on duty Jan. 6, responding to reports of explosive devices outside the building and monitoring police radio communications of the assault.

The next day, according to the indictment, Riley reached out to an unidentified person who posted commentary and photographs, as well as videos of himself inside the Capitol on Facebook.

“Hey [Person 1] im a capitol police officer who agrees with your political stance,” Riley wrote, the indictment alleges. “Take down the part about being in the building they are currently investigating and everyone who was in the building is going to charged. Just looking out!”

The pair had never communicated before but shared an affinity for fishing, and the person had replied to Riley’s friend request Jan. 1, the indictment said.

In dozens more messages, the person sent videos of himself smoking a hand-rolled cigarette in the Capitol, and the two discussed among other things injuries to police, the death of Officer Brian D. Sicknick and fishing, charging papers said.

But on Jan. 12, after the person said his presence at the Capitol was drawing attention online, Riley again allegedly advised, “Get off of social media.” When the person asked if he had been charged, Riley wrote, “Call me,” and the pair spoke for 23 minutes, according to the indictment. Within hours, the person texted two others saying that he had spoken to “capitol police” and that charges against him were likely to be trespassing, the indictment said.

On Jan. 19, the man was arrested and interviewed by the FBI. He messaged Riley the following day, “The fbi was very curious that I had been speaking to you. If they havent already asked you about me they are gonna. They took my phone and downloaded everything,” court papers said.

“That’s fine,” Riley responded, according to the charges, before deleting messages with the man.

On Jan. 21, 12 days after acknowledging a video and photo of the man smoking in the U.S. Capitol, Riley allegedly messaged: “Hey [Person 1], another mutual friend was talking about you last night. I tried to defend you but then he showed me a video of you smoking weed and acting like a moron. i have to say I was shocked and dumbfounded . . .,” according to charging papers.

“I was so mad last night I deleted all your post, but I wanted to text you this morning and tell you that I will no longer be conversing with you,” Riley continued in his final message to the man, the indictment said.

Capitol Police had announced last month that disciplinary action has been recommended in seven cases against officers following internal investigations into the Jan. 6 breach, which authorities said contributed to five deaths, assaults on about 140 officers and the delay of Congress’s certification of the 2020 election victory of President Biden.

It was not immediately clear if Riley’s was among those cases. Capitol police said their Office of Professional Responsibility launched 38 internal investigations and was able to identify the officers involved in 26 of those cases. In 20 of the cases, no wrongdoing was found, according to a statement. A Capitol Police spokesman confirmed that Riley was honored in 2011 for saving the life of a fellow officer who had fallen on ice and hit his head on the pavement during a snowstorm.

Riley, having volunteered to work an extra shift to help during the storm, gave CPR to the injured officer, who had been knocked unconscious, was bleeding from the head and had no pulse. The officer survived after undergoing quadruple heart-bypass surgery and had no brain damage.