A Delaware man found with a loaded gun and more than 100 rounds of ammunition outside a Westfield elementary school last year was sentenced Friday to five years in state prison.

Thomas Wilkie must serve a minimum of 42 months behind bars before being eligible for parole, according to the Union County Prosecutor’s Office. Police found the 46-year-old outside Tamaques Elementary School on June 13, 2019 after receiving a tip from the New Castle County Police in Delaware, who learned he was headed to the school and possibly armed.

Wilkie was holding a .45-caliber handgun loaded with hollow point bullets, according to authorities. Officers also recovered two more loaded clips of ammunition and a folding knife from him, along with 130 rounds of ammunition in the trunk of his car. He was arrested without incident and charged with weapons offenses.

Wilkie’s father, George, previously told NJ Advance Media his son went to the school to see a current or former girlfriend.

Speaking at sentencing in Union County Superior Court, Thomas Wilkie read from a five-page handwritten note, according to an account from the prosecutor’s office.

He expressed remorse for his crimes - calling his actions “unconscionable, frightening, and unacceptable,” and thanked the police officers who arrested him. Wilkie credited cops for “professionalism, restraint, and mercy," in defusing the tense scene.

“The bravery and professionalism demonstrated by Officers Jeffrey Johnson and Michael Pollack of the Westfield Police Department was exemplary. Their quick thinking and heroism deescalated a situation that easily could have turned tragic,” Acting Union County Prosecutor Lyndsay V. Ruotolo said in a statement.

Wilkie pleaded guilty last month to unlawful possession of a weapon. Assistant Prosecutors Theresa Hilton and Nicole Siano handled the case.

“The defendant went to school with a gun … and there were children present,” Siano said.

Authorities did not allege Wilkie planned to harm children at the school, but the incident forced a lockdown of the building and left parents in fear.

Wilkie admitted to police that he had a gun and ammunition, but claimed it was for self-defense, according to court documents. He said he was at the school to visit a teacher, who he called before he was arrested.

Noah Cohen may be reached at ncohen@njadvancemedia.com. Follow him on Twitter @noahyc. Find NJ.com on Facebook.

Have a tip? Tell us: nj.com/tips. Get the latest updates right in your inbox. Subscribe to NJ.com’s newsletters.