The president and CEO of PacketSled, a cybersecurity firm that develops software to detect the origin of cyber attacks, has resigned after he posted threats to assassinate President-Elect Donald Trump with a sniper rifle.

Matt Harrigan apologized for his “flawed joke” and “lack of judgment” after comments he made on his Facebook page about killing Trump went viral.

Matt Harrigan is the CEO of PacketSled and Critical Assets and a board member for OWASP.

And he wants to Kill Donald Trump. pic.twitter.com/SDNlhErJjW — America First! (@America_1st_) November 13, 2016

“I’m going to kill the president. Elect.,” Harrigan threatened in one of the now-deleted Facebook posts shared widely on Reddit.

When a fellow Facebook user warned Harrigan of the FBI’s interest in such threats, the former CEO replied, “Bring it secret service,” before delving into further detail about just how he planned to take out Trump.

“Getting a sniper rifle and perching myself where it counts. Find a bedroom in the White House that suits you, motherf***er. I’ll find you,” he wrote.

READ MORE: Michelle Obama racial slur: US mayor under fire over viral Facebook post

On Monday Harrigan was initially placed on administrative leave and PacketSled said they had “immediately reported [the comments] to the secret service.” By Tuesday the San Diego based start-up had accepted Harrigan’s resignation “effective immediately.”

PacketSled Accepts Matthew Harrigan Resignation: pic.twitter.com/ukwLdeO9YO — packetsled (@packetsled) November 15, 2016

On Twitter, Harrigan said the “joke” was taken “out of context” and had “no malicious intention towards the #POTUS”.

My humble apologies that a flawed joke has become public/out of context. My poor judgement does not represent the views of @packetsled … — Matt Harrigan (@mattharrigan) November 13, 2016

customers, investors or the officers of @packetsled. I have no malicious intention towards the #POTUS, and apologize to all for … — Matt Harrigan (@mattharrigan) November 13, 2016

my lack of judgement and offensive commentary. I wish you all well. — Matt Harrigan (@mattharrigan) November 13, 2016

Under US law, threatening a president- or vice-president-elect is a federal crime. Anyone who “knowingly and willfully threatens to kill, kidnap or inflict bodily harm upon” the president-elect could face a fine and up to five years in prison.