SAN ANTONIO (AP) — A former student at a San Antonio school has been sentenced to eight years in prison for taking loaded guns to campus.

Brendan Sean Tarwater was sentenced Wednesday in San Antonio in a plea deal.

Prosecutors say Tarwater in April 2014 took guns to James Madison High School, when he was a sophomore and 17 years old. Nobody was hurt.

Tarwater, who's now 18 and prosecuted as an adult, in June pleaded no contest to a third-degree felony of taking prohibited items — guns — to school. The weapons — an AK-47, two handguns, ammunition and a knife — were found in Tarwater's backpack after his parents reported him missing.

Tarwater originally was also charged with making terroristic threats.