BOSTON (CBS) — A Mansfield man charged with threatening President Barack Obama online last year changed his plea to guilty in federal court Thursday morning.

Federal prosecutors said Andrew O’Keefe, 28, of Mansfield, wrote on an FBI tips website on May 15, 2015 that he had a plan to kill President Obama.

READ MORE: Nantucket Author Elin Hilderbrand To Retire From Writing Beach Reads

“I’m planning to kill President Barack Obama,” authorities said O’Keefe wrote on the site. “I’ve got a really good plan. Have the Secret Service give me a visit.”

He signed the post with his Social Security number.

The Secret Service took him up on his offer for a visit, eventually calling in a SWAT team when O’Keefe would not open his door, and a Hazmat team when they saw the conditions of his home.

Authorities said they were alarmed to find over 100 weapons, including a number of knives, swords, and throwing stars, in his home.

READ MORE: Massachusetts Surpasses Goal Of 4.1 Million People Vaccinated Against COVID-19

WBZ NewsRadio 1030’s Karyn Regal reported that O’Keefe’s parents were his only supporters in court.

Bill Cintolo, O’Keefe’s attorney, called his client’s situation “an unfortunate incident.”

“Somebody doesn’t give their address and their Social Security number if they’re trying to hide something,” he said after court Thursday.

O’Keefe faces up to five years in prison.

MORE NEWS: Boston Marathon Will Return To Patriots Day For 2022

WBZ NewsRadio 1030’s Karyn Regal reports