“This is [Social Security number] speaking. I’m planning to kill President Barack Obama, and I’ve got a really good plan,’’ the online message, posted to an FBI tips website, said. “Have the Secret Service give me a visit. I could use some company.’’

That short missive led to a criminal charge for Andrew O’Keefe of Mansfield, Massachusetts. O’Keefe, 28, appeared in U.S. District Court on Monday and was charged with one count of posting an online threat to the president.

According to a criminal complaint, law enforcement agents arrived at O’Keefe’s apartment in Mansfield on May 15 — two days after the message was posted — to speak with him. He refused to open the door and did not answer his cell phone when agents called, the complaint said.


A Secret Service agent then pushed a printed copy of the online threat under the door, and attempted to convince O’Keefe to leave the apartment and discuss the message.

“O’Keefe responded shortly after that ‘free speech’ is not a crime and words have no meaning and are only ‘myths,’’’ according to the complaint. O’Keefe also said that he needed to eat “to have enough energy’’ to survive being shot by police, the complaint alleges.

About an hour after the agents’ arrival, O’Keefe voluntarily left the apartment. His behavior was “agitated’’ and his speech “not appropriate’’ and “menacing,’’ the complaint said.

A search warrant of O’Keefe’s apartment recovered over 100 weapons, including knives, hatchets, spears, and swords. In addition, a search of his computer showed he had recently visited the FBI tips site and had the same IP address as the one recorded on the threat to the FBI website.

O’Keefe did not enter a plea and waved his right to a prompt detention hearing in court on Monday. William Cintolo, O’Keefe’s attorney, told Boston.com O’Keefe would have entered a not guilty plea if there had been a plea.

If convicted, O’Keefe faces up to five years in prison for the threat charge. He also faces weapons charges in state court.