Linda Shaw Thomas, 47, was stabbed 21 times on March 3 after someone broke into her home east of Raeford, authorities said. She called 911 during the attack, and her screams awoke her two foster children, girls ages 15 and 17.
Allen Thomas Sr., 51, surrendered to his son and Hoke County deputies after hiding out in the woods for two days.
Linda and Allen Thomas had been divorced for 10 years, and she took out a restraining order against him in July 2007 to keep him from entering her home, authorities said.
The couple's son and daughter agreed to the plea deal, which spared their father the prospect of a death sentence if convicted at trial.
Linda Thomas had worked in local schools for 27 years, most recently as a librarian at Hoke County High School.