A Pennsylvania man was arrested this week after the authorities said he threatened to assassinate President Trump, Elon Musk and other government officials in comments that he posted on YouTube.
Google, which owns YouTube, alerted the F.B.I. on Tuesday to the threatening comments, which were posted by someone using the username “Mr Satan,” whom the authorities later identified as Shawn Monper, of Butler, Pa., according to a criminal complaint.
Mr. Monper, 32, was arrested on Wednesday and charged with four counts of influencing, impeding or retaliating against a federal official and a federal law enforcement officer.
According to the court documents, Mr. Monper wrote, “im going to assassinate him myself” in the comments under a livestream of Mr. Trump’s address to a joint session of Congress on March 4.
In a comment on another YouTube video on Feb. 17, according to the complaint, Mr. Monper wrote, “Nah, we just need to start killing people, Trump, Elon, all the heads of agencies Trump appointed, and anyone who stands in the way.”
On Feb. 26, according to the complaint, Mr. Monper wrote that he had “bought several guns” and had been stocking up on ammunition since Mr. Trump took office for a second time, promising “to do a mass shooting.”
Butler, Pa., where Mr. Monper lives, was the site of a campaign rally where Mr. Trump was injured in an assassination attempt on July 13. The complaint did not mention that episode.
Mr. Monper’s lawyer did not respond to requests for comment on Friday.
In addition to Mr. Trump and Mr. Musk, Immigration and Customs Enforcement agents were also a target of Mr. Monper’s threats, federal prosecutors said.
As the Trump administration has ramped up its deportation efforts, ICE and Department of Homeland Security agents have come under scrutiny for detaining students and legal immigrants.
On Friday, an immigration judge in Louisiana found that the Trump administration could deport a Columbia University graduate and legal permanent resident, Mahmoud Khalil, for his role in pro-Palestinian demonstrations on campus last year.
In a statement on Friday, Attorney General Pam Bondi thanked the F.B.I. and the Butler Township police for their work on the investigation.
“Rest assured that whenever and wherever threats of assassination or mass violence occur, this Department of Justice will find, arrest, and prosecute the suspect to the fullest extent of the law and seek the maximum appropriate punishment,” she said.