MIAMI — A 20-year-old college student who told investigators he was merely trying to get a reaction from President Barack Obama’s supporters pleaded guilty Wednesday to posting threatening messages against Obama on Facebook.

Joaquin A. Serrapio Jr. could get up to five years in federal prison for pleading guilty to a single count of threatening to kill or harm the president, but likely will get less time, said his attorney Alan Ross.

Sentencing is scheduled for Aug. 22.

There is no evidence that Serrapio intended to carry out any threat against the president, and Obama was never in any danger, investigators said.

“He wanted to get a reaction from political supporters of President Obama,” Ross said.

Serrapio is a music business major at Miami-Dade College who also fronts for a rock group called the “J. Valor Band.”

Using the “Jay Valor” page on Facebook, prosecutors said Serrapio posted two threatening messages around the time Obama visited South Florida in February to deliver a speech at the University of Miami and attend two fundraisers.

In the first post on Feb. 21, Serrapio wrote, “Who wants to help me assassinate Obummer while hes at UM this week?”

On Feb. 23 — the day of Obama’s visit — the Secret Service said Serappio posted a second threat.

“If anyones going to UM to see Obama today, get ur phones out and record,” the message stated.

“Cause at any moment im gonna put a bullet through his head and u don’t wanna miss that! Youtube!”