A former elementary school janitor has been sentenced to one year in prison after pleading guilty to stealing laptops from the campus where he worked.

Kenneth Foster, 34, was sentenced in Prince George’s County Circuit Court on Thursday and ordered to pay $18,000 in restitution with five years probation, prosecutors announced in a statement.

Foster worked at Vansville Elementary School in Beltsville, Md., at the time of the theft, according to the Prince George’s County state’s attorney’s office. The school received about $30,000 worth of MacBooks in January 2014 and put them in storage, but when officials went to retrieve them months later, they found that the equipment had disappeared, prosecutors said.

Foster had left the school system on medical leave shortly after the laptop delivery and was still on leave when authorities discovered that the computers were missing, prosecutors said. Authorities later learned that Foster was working in a North Carolina school district when several iPads went missing and while he supposedly was still on medical leave from Prince George’s, prosecutors said.

Investigators later found that Foster was selling the iPads and MacBooks on Craigslist.

Authorities recovered 18 of 30 stolen laptops.

Foster was charged in North Carolina in 2015, prosecutors said. In May, Foster pleaded guilty in Prince George’s to one count of a theft scheme between $10,000 and $100,000.