HACKENSACK, N.J. - A longtime teacher at a northern New Jersey magnet high school who had sex with a student is now headed to prison.

Donald DeWitt received a four-year sentence on Friday. He also will have to register as a sex offender.

The 65-year-old Warwick, New York man had pleaded guilty in February to child endangerment as part of plea deal with Bergen County prosecutors.

advertisement | advertise on newsday

DeWitt was arrested in April 2015 after the 16-year-old victim's sister discovered emails DeWitt had sent the teen. The sister told their mother, who contacted her local police department. Officials there then notified county prosecutors.

DeWitt has been a full-time staffer at the school since 1992 and taught numerous courses. He was fired when he pleaded guilty.