BOSTON (AP) — A Massachusetts man has been sentenced to time served after pleading guilty to posting on an FBI website that he planned to kill the president of the United States.

The U.S. Attorney’s office says Andrew O’Keefe, of Mansfield, will be under supervised release for five years after being sentenced Thursday by a federal judge.

READ MORE: Coronavirus In Massachusetts: Today's Developments

Last May, prosecutors say O’Keefe wrote on an FBI tips site that he was “planning to kill President Barack Obama,” and had “a really good plan.” He invited the Secret Service to pay him a visit and signed the posting with his Social Security number.

READ MORE: NH Police Searching For Missing 5-Year-Old Boy Elijah Lewis

A search of O’Keefe’s home and car turned up more than 100 weapons, including swords, double-edged knives, hatchets and spears.

O’Keefe, who pleaded guilty in December, spent about six months in custody.

MORE NEWS: Case Of Rat-Borne Bacterial Disease Identified In Boston

(© Copyright 2017 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)