For months, the FBI had been investigating a Butler County man who they said had pledged his support to the extremist Islamic State group.

But on Saturday, officials said, Jonathan Hunter Kramer began ramping up his activity, prompting them to take immediate action.

Kramer, 21, of Valencia was arrested that day after he was stopped leaving a sporting goods store where he had just purchased rifle magazines and boxes of ammunition. At his hotel room in Cranberry, agents later recovered a semiautomatic rifle, a rifle bipod, a scope, an entrenchment tool, a prayer rug and a cellphone and bag to protect it from sending or receiving signals.

“What you saw Saturday is an individual that, quite frankly, accelerated his mobilization to do an attack,” FBI Pittsburgh Special Agent in Charge Richard Evanchec said Tuesday.

Pittsburgh’s Joint Terrorism Task Force “successfully disrupted what we assess to be an imminent threat of violence inspired by ISIS.”

Officials would not say what specific location was allegedly being targeted, but noted that Kramer described methods of mass casualty attacks, including targeting schools, nightclubs, theaters, concerts, apartment buildings and synagogues.

“Let me be clear about this threat,” Evanchec continued. “Jonathan Kramer demonstrated a sustained devotion to the Islamic State of Syria. He recorded a pledge of allegiance to the same. Following that pledge, he made efforts to spread their propaganda and shared ways to kill, all in the name of a foreign terrorist organization.”

In a Justice Department news release, Assistant Attorney General for National Security John Eisenberg said Kramer appeared to be preparing for a mass shooting, having secured a rifle and nearly 200 rounds of ammunition.

“His apparent ISIS inspiration and escalation toward violence show how close this country came to a devastating attack,” Eisenberg said. “This arrest prevented what could have been a horrific tragedy.”

Kramer is being represented by the federal public defender’s office, which declined comment Monday night.

He is a 2023 graduate of Mars Area High School, the district confirmed on Tuesday.

Kramer had been previously adjudicated delinquent on state charges including possession of child sexual abuse material and “his role in a plot to commit a mass casualty incident” in 2023, according to the federal criminal complaint.

Butler County District Attorney Richard Goldinger said he could not discuss the details of that case and noted that, generally, juvenile court records are open to the public only when a defendant is 15 or older and charged with a felony.

According to the federal complaint, Kramer was held in a juvenile facility in Oil City until March when he was released.

Within days, the FBI received an online, anonymous tip about Kramer’s behavior.

According to the tip, Kramer was “ordering ‘mysterious’ packages, and his parents do not check because Kramer ‘needs privacy,’” a federal criminal complaint said.

The tip also relayed that Kramer got a cellphone and that he was “‘talking to his friends from before,’ when he was charged in Pennsylvania with ‘terrorism, threats to use a weapon of mass destruction and terrorist threats.’”

At a news conference Tuesday in the federal courthouse in Downtown Pittsburgh, U.S. Attorney Troy Rivetti urged the public to remain alert, noting that a single tip can make a difference.

“We hope that this prosecution serves as a stark reminder to everyone of the importance of vigilance, the need for all of us to work together to keep our district and our nation safe,” Rivetti said. “By reporting to law enforcement when you see or hear what appears to be criminal, threatening and dangerous, you help us in our mission, and our primary mission is public safety and public health.

“Violence prevention is the touchstone of all we do.”

Rivetti also said that the law enforcement officials working on Kramer’s case over the weekend were well aware that the nation had just marked the 25th anniversary of the Sept. 11 terrorist attacks, and that the Jewish community was celebrating Rosh Hashanah, which marks the Jewish New Year.

“That was top of mind to everyone,” Rivetti said.

Evanchec agreed.

“This case is therefore a stark reminder that even a quarter of a century later, law enforcement continues to confront a dynamic, persistent and evolving terrorism threat landscape,” Evanchec said.

“We never forget that it was here, outside Pittsburgh, where the passengers and crew of Flight 93 chose to make their stand, and their sacrifice continues to remind us that the fight against terrorism is both personal and profoundly tied to this region.”

Kramer is scheduled for a hearing in federal court on Wednesday.