Hours after he joined a mob of pro-Trump rioters in the U.S. Capitol earlier this month, Garret A. Miller took to social media to brag about his actions and to lob threats at lawmakers and police, federal investigators said. When Rep. Alexandria Ocasio-Cortez (D-N.Y.) tweeted “Impeach,” referring to President Donald Trump, Miller’s response was grim.

“Assassinate AOC,” Miller, 34, allegedly wrote.

That comment, along with a trove of other posts on social media, led to Miller’s arrest on Wednesday. He was charged with unlawful entry of the Capitol on Jan. 6, violent entry and disorderly conduct on Capitol grounds, obstruction or impeding any official proceedings, civil disorder and making threats, according to a criminal complaint. Miller first appeared in the U.S. District Court for the Northern District of Texas on Friday.

Ocasio-Cortez later said on Instagram Live that during the “traumatizing event” inside the Capitol riots, there were moments when she thought she was going to die and that it was “not an exaggeration” to say many lawmakers were “nearly assassinated.”

A spokeswoman for Ocasio-Cortez did not immediately respond to a request for comment.

In an Instagram Live video, Rep. Alexandria Ocasio-Cortez (D-N.Y.) on Jan. 12 recounted her experience at the Capitol during the Jan. 6 riots. (AOC/Instagram)

The FBI was notified of Miller on Jan. 8, according to court documents, when law enforcement sent federal agents a video Miller had posted on Twitter of people roaming the Rotunda and waving Trump and American flags with the caption, “From inside congress.” Days later, Miller posted images of crowds outside the Capitol.

With a subpoena of Miller’s account, federal agents say they tracked down the number associated with the Twitter handle and connected it to Miller, who lives in Dallas County. Investigators then found Miller’s Facebook account, where they found more posts relating to his activities at the Capitol.

On Jan. 2, Miller posted on Facebook that he was going to drive to the rally in D.C., and predicted an event involving violence and unrest, investigators said.

“Some crazy s--- going to happen this week,” Miller wrote. “Dollar might collapse … civil war could start … not sure what to do in DC.”

The following day, he wrote that he was going to bring “a grappling hook and rope and a level 3 vest. Helmets mouth guard and bump cap.” Miller added that unlike the last time he went to D.C. for a pro-Trump rally, he wasn’t going to bring his guns.

On the day of the insurrection, Miller defended the violent mob in several tweets by claiming they were “gentle with police” and “overwhelmed them but did not injure them,” according to court documents. The Washington Post has reported that dozens of police officers were beaten and injured. One officer died of injuries and another died by suicide.

Miller also broadcast his exploits in the Capitol on Instagram and Facebook, federal investigators said. In response to a comment on his Facebook page asking whether he was inside the Capitol, Miller wrote that he “charged the back gates myself” and that he knew he was going to force his way into the building “no matter what.”

He also acknowledged that by posting on social media he “just wanted to incriminate myself a little lol.”

For days afterward, federal investigators said, Miller continued to post more evidence of his escapades. On Instagram, he wrote that he “had a rope in [his] bag on that day,” court documents said. On Jan. 11, he posted a picture of himself wearing a Make America Great Again hat in the Rotunda.

Miller also allegedly commented on the fatal shooting of Capitol rioter Ashli Babbitt, a 35-year-old Air Force veteran from Southern California who avidly followed the QAnon conspiracy theory. A Capitol Police officer fired at Babbitt as she tried to climb through a window and into the office lobby of House Speaker Nancy Pelosi (D-Calif.).

Miller hurled online threats at the officer, saying that if he got his hands on him, he would “hug his neck with a nice rope,” according to court documents. On Jan. 16, he wrote on Facebook that “its huntin season” and that the officer “deserve[s] to die.”

In a Facebook chat, investigators said, Miller admitted that he was “happy to make death threats.” And when he was asked whether police knew his name, he said it was probably time for him to “be hard to locate.”

In addition to citing the incriminating evidence on Miller’s social media accounts, federal officials said he’s also visible on surveillance footage inside the Capitol on Jan. 6. One clip shows Miller inside the Rotunda at 2:46 p.m. wearing a red MAGA hat and carrying a pro-Trump flag and an American flag, with his face covering pulled down below his neck. Another video shows him in a crowd at the entrance of the Rotunda, pushing past Capitol Police officers.

Miller is one of more than 100 people who have been charged with breaching the Capitol earlier this month. Last week, Thomas Fee, a 53-year-old retired New York City firefighter from Freeport, N.Y., was arrested and charged after he allegedly sent his girlfriend’s brother — who is a federal agent — a picture of himself inside the Rotunda. Similar to Miller, many alleged rioters have openly bragged about their exploits on social media, making it easier for federal agents to track them down and connect them to the insurrection.

In a statement to The Post, Miller’s attorney, Clint Broden, said his client “regrets the actions he took on Jan. 6,” calling them a “misguided effort to show his support for former president Trump.”

“Mr. Miller understands that his social media post[s] reflect very ill-considered and completely inappropriate statements made in very divided times and will certainly not be repeated in the future,” Broden said. “He has always been a law-abiding citizen. He accepts full responsibility for his actions and is prepared to testify at any legal or Congressional proceeding. Most importantly, Mr. Miller recognizes the election is over and Joe Biden is President of the United States.”

Miller is due back in court for a detention hearing on Monday, according to the Justice Department.