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: 'Surgery Shmurgery': David Andrews Played Through A Pretty Serious Injury In 2021

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: Thousands Of Chain Saws Recalled 'Due To Injury Hazard'

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: Julian Edelman Has The Very Best Suggestion For NFL Overtime Rule Change

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