As he prepared to head to Washington to attend President Donald Trump’s Jan. 6 ”Save America” rally, Kenneth Grayson made his intentions clear to friends and followers on Facebook.

“IF TRUMP TELLS US TO STORM THE F — N CAPITAL [sic], IMA DO THAT THEN!” he wrote, adding later: “I’m with a group going to fight, not hang out.”

On Tuesday, FBI agents arrested him at his home in Bridgeville in the Pittsburgh suburbs, three weeks after they say he followed through on that threat.

Prosecutors say Grayson, 51, joined the throng of pro-Trump insurrectionists who invaded the Capitol that day, donning a Pittsburgh Pirates hat and a hoodie emblazoned with American flag and QAnon patches. He livestreamed his exploits on Facebook, according to investigators — even as friends and family members chimed in with advice in real time.

“Kenny, get the hell out of there,” one viewer wrote, according to court filings in his case. “It’s a federal offense to be in there.”

Another cheered him on, writing: “Kenny, they’re in the Senate chamber! Can you get in anywhere?? TAKE PHOTOS!!! TAKE DOCUMENTS!!”

Grayson is just one of the 135 Capitol rioters that the FBI has tracked down through the evidence they left on their social media accounts. And like many of the others who have also been arrested, it was his friends, coworkers, and in some cases family members who alerted the FBI.

According to the arrest affidavit filed in Grayson’s case, at least four people — some of them former classmates — contacted the FBI after seeing his livestream.

They warned that Grayson was an avid devotee of QAnon, the baseless far-right conspiracy theory that holds Trump is in an epic battle against a cabal of Satan-worshipping, child-trafficking celebrities and Democratic Party officials who secretly run the world.

They shared messages Grayson had sent from earlier trips to attend Trump rallies in Washington, including a Nov. 16 protest that saw violent clashes between pro-Trump Proud Boys and counterdemonstrators.

“I was beating commies with a flagpole I picked up,” he boasted in one message quoted in court filings. “I left one unconscious, so I did my little part.”

And they flagged a photo Grayson had posted of himself in front of the Washington Monument just hours before the Capitol attack, holding a Gadsden flag with its recognizable image of a coiled snake and the slogan “Don’t Tread on Me,” popular with right-wing groups.

But ultimately it was the footage Grayson shot on his phone as he dragged that flag through the Capitol Rotunda and the crypt beneath it that led to his arrest.

During his first court appearance in Pittsburgh on Tuesday, Grayson told a judge that despite his Facebook posts, he lives a “pretty basic humdrum life” consisting of work and caring for his 76-year-old father, a retired police officer, and 74-year-old mother.

He will remain in federal custody pending a bail hearing set for Thursday. Like the eight other Pennsylvania residents who have been federally charged with crimes connected to the riot, Grayson’s case will play out in Washington.

Read the FBI’s affidavit: