The CEO of a California-based cybersecurity firm has resigned after threatening to assassinate President-elect Donald Trump, saying his “flawed joke” showed a lack of judgment.

Matt Harrigan, who founded San Diego’s PacketSled in 2013, posted the comments on his Facebook page throughout Election Day, but the account is no longer active. Some of the messages, however, were captured on Reddit, revealing Harrigan’s threat to “kill” the president-elect with a sniper rifle, the San Diego Union-Tribune reports.

The company on Tuesday announced that it accepted Harrigan’s resignation, one day after he was placed on administrative leave.

“We want to be very clear, PacketSled does not condone the comments made by Mr. Harrigan, which do not reflect the views or opinions of the company, its employees, investors or partners,” the statement read.

The company’s chief technology officer, Fred Wilmot, will serve as interim CEO while a search for a replacement is conducted, according to the statement. PacketSled, which provides tools for monitoring network security, raised $5 million in July. The company lists the city of San Diego as a client on its website.

PacketSled officials announced Monday that they were taking Harrigan’s comments seriously and notified federal authorities.

“Once we were made aware of these comments, we immediately reported this information to the Secret Service and will cooperate fully with any inquiries,” company officials said in a statement. “These comments do not reflect the views or opinions of PacketSled, its employees, investors or partners.”

Harrigan addressed the controversy Sunday, saying his comments were a “flawed joke” that fell flat.

“My humble apologies that a flawed joke has become public/out of context,” Harrigan posted on Twitter. “My poor judgement [sic] does not represent the views of @PacketSled.”

In a subsequent post, Harrigan said he had “no malicious intention” toward Trump and again apologized for a lack of “judgement [sic] and offensive commentary.”

“I wish you all well,” Harrigan posted in a third tweet.

Harrigan, according to a copy of the messages posted on Reddit, was apparently not concerned after one of his Facebook friends suggested he might be contacted by federal authorities.

“Bring it secret service,” Harrigan replied.

He also rejected another friend’s suggestion to “get high” after the election soured his mood.

“Nope, getting a sniper rifle and perching myself where it counts,” Harrigan wrote. “Find a bedroom in the whitehouse that suits you, [expletive]. I’ll find you.”

The US Secret Service is aware of Harrigan’s postings on social media, but declined further comment, David Murray, special agent in charge in San Diego, told the Union-Tribune.

But a security source told The Post that the Secret Service would investigate all social media postings containing credible threats, adding that there’s a difference between someone saying they’re planning to kill the president and suggesting that someone else should attempt an assassination. Generally, indirect threats are not prosecuted, according to the source, and investigators will “prioritize” them before determining their credibility.