The first call about the shooting came in at 2:04 p.m. Forty-year-old Chahnaz Kebaier, of Chapel Hill, was taken to UNC hospitals where she later died after being shot multiple times in the head and body.
Police said the suspect in the shooting is 49-year-old Ali Cherfaoui, of Carrboro.
Chapel Hill Police Chief Christopher Blue said his officers then stopped Cherfaoui in a car headed north on Hwy 15-501 at Raleigh Road and took him into custody.
Cherfaoui has been charged with murder. At last report, he was being held in the Orange County Jail without bond.
Police said Friday's incident is believed to be related to an ongoing domestic dispute between Cherfaoui and Kebaier.
Chapel Hill mayor Mark Kleinschmidt said in a statement, "We are in shock and grieve for the loss of a resident, and for the family, friends and acquaintances of Chahnaz Kebaier. Our prayers go up for them and the entire Scroggs School Family. We are deeply saddened and are very sorry this happened."
"I want to thank Chief Chris Blue and the entire Chapel Hill Police Department for their fast action to restore safety and security to our community," he continued.
Parents described the chaotic scene at the school.
"I heard three or four loud bangs and I really didn't register what it was because you don't expect there to be gunshots outside your school and then someone came running in saying that someone had been shot," said parent Emily Martine, who was inside the school at the time of the shooting.
Martine said the staff sprang into action. The principal and school nurse responded without knowing the shooter's whereabouts.
"You just have to admire their bravery for that," said Martine. "And the police were here really fast."
Parents showed up at the school horrified but relieved that there were no injuries.
"We served a very good merciful savior and so I'm going to trust in him in all things and I thank God that my son is OK," said parent William Ryan.
Parents who live in the area told ABC11 that the conversations they were forced to have with their kids were difficult.
"I think this is the first time I've ever dealt with something like this," said parent Stephanie Burgess. "It's always not in my neighborhood, not in my school. I guess it can happen anywhere."
The school was on lockdown for about an hour until the all-clear was given. Police said no students or staff were injured.
A support team will be at the school on Monday morning and all day Tuesday to help any child or adult cope with the situation.