Forty-one-year-old Julio Gonzalez-Pagan pleaded guilty to second-degree murder Tuesday minutes before jury selection for his York County trial was to begin.
Judge Michael Bortner immediately imposed the mandatory sentence of life in prison without possibility of parole.
Authorities said 33-year-old Jessica Morales had left the defendant and moved to York from New Philadelphia, Ohio.
They said Gonzalez-Pagan followed her to her new home in November 2009 and shot her in the chest and head.
Assistant public defender Erin Thompson told the York Daily Record ( http://bit.ly/TYDWDE) that her client entered the plea because he didn't want to relive the slaying.
Information from: York Daily Record, http://www.ydr.com