WESTFIELD, N.J. (CBS/AP) — A New Castle County man accused of bringing a loaded gun and ammunition to a New Jersey elementary school pleaded guilty Monday to a weapons charge. Thomas Wilkie, 46, of Bear, Delaware admitted he did not have a permit in New Jersey to possess a handgun police found on him, although he did have a permit for the weapon in his home state.

He pleaded guilty to unlawful possession of a weapon as part of a deal with Union County prosecutors, who dismissed other charges against him.

Wilkie faces up to 10 years in state prison when he’s sentenced Feb. 21.

He was charged after Westfield police responded last June to a report from police in New Castle County in Delaware, who said a potentially armed Wilkie was headed to the Tamaques Elementary School.

Classes had already ended by the time police found Wilkie, but the school was locked down as a precaution. During Monday’s court hearing, Wilkie said he had no intention of entering the school with the gun.

Authorities say Wilkie had a 45-caliber handgun loaded with hollow-point bullets and two more loaded clips of ammunition on him when he was arrested. They say another 130 additional rounds were found in the trunk of his SUV.

Authorities have not said why Wilkie drove to the school.

(© Copyright 2020 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)