A Maryland man accused of plotting to kill President Barack Obama has been sentenced to more than five years in federal prison.

Twenty-year-old Collin McKenzie-Gude pleaded guilty in September to possessing bomb-making chemicals. A former friend testified that McKenzie-Gude disliked Obama's gun control positions and planned to assassinate the then-presidential candidate.

U.S. District Judge Peter J. Messitte handed down the sentence Tuesday. The judge says McKenzie-Gude's weapons collection and chemicals could have had serious consequences.

McKenzie-Gude cried as he told the judge that he was sorry and regretted his actions.