A 20-year-old Markham man has pleaded guilty to second-degree murder in connection with a 2012 stabbing behind a library.

In a statement released on Tuesday, York Regional Police say the man appeared before the Ontario Superior Court last week and pleaded guilty to second-degree murder. The man, who was 17 at the time of the stabbing, was handed a sentence of seven years with six months of credit for time served.

Police previously said Allen Constance, 28, was found near the Markham Village Library on Highway 7 East on May 13, 2012. He was rushed to hospital, where he died of his injuries.

York Regional Police previously told CTV Toronto Constance and the suspect knew each other through friends.