(Reuters) - A Florida man was sentenced to 20 years in prison on Monday for shooting at George Zimmerman, who had shot and killed unarmed black teenager Trayvon Martin in 2012 in a case that garnered national attention, prosecutors said.

Matthew Apperson, 37, was convicted by a jury last month of second-degree attempted murder for firing at Zimmerman, 33, during a roadside confrontation in Lake Mary, Florida in May 2015.

A Sanford, Florida jury had acquitted Zimmerman, a former neighborhood watchman, of murder in the fatal shooting of the 17-year-old Martin. The case sparked the Black Lives Matter activist movement that campaigns against violence towards black people.

Circuit Court Judge Debra Nelson in Seminole County called Apperson "a danger to the community" as she handed down the mandatory minimum sentence on Monday, ABC-affiliate WFTV 9 said.

Apperson also was sentenced to 15 years each for convictions of shooting into an occupied vehicle and aggravated assault with a firearm stemming from the altercation with Zimmerman, who sustained minor injuries from shattered glass, Florida State Attorney spokeswoman Lynne Bumpus-Hooper said.

The judge ordered the sentences be served concurrently.

"Bottom line, it's a 20-year sentence," Bumpus-Hooper said.

Apperson served about 14 months of his sentence while awaiting and undergoing trial.

His attorney was not immediately available for comment.

During his trial, Apperson testified that the shooting was in self defense. Zimmerman testified it was unprovoked and that he and Apperson had been involved in another roadside altercation in September 2014, in which Apperson, who is white, had accused him of being in the wrong over the shooting death of Martin.

Zimmerman claimed to have acted in self-defense when he shot Martin, a high school student who was walking through the community after stopping at a convenience store.

(Reporting by Laila Kearney; Editing by Colleen Jenkins and Alan Crosby)