Alvaro Rafael Castillo, 19, of Hillsborough told deputies after he was taken into custody at Orange High School that he killed Rafael Huezo Castillo, the Orange County sheriff said.
Deputies who forced their way into the family's home found the body of the father, who had been shot to death, Sheriff Lindy Pendergrass said.
It was not immediately known when the father died.
A former student drove into the school's parking lot at midday and fired a gun at the building, spokeswoman Anne D'Annunzio said. A girl was grazed on the shoulder, and a boy was struck by shattered glass, she said.
Castillo has not been charged in the school shooting.
The injured girl was treated at a hospital and released, D'Annunzio said.
"It was very superficial," D'Annunzio said. "I saw her before she was transported, and she was laughing and talking."
Ninth-grader Philip Mitchell said he was outside when the shooting started about 1 p.m.
"There was a bunch of smoke and they started shooting," said Mitchell, who ran back inside the building.
Denning Best, another high school freshman, was in the cafeteria.
"I saw people running away and all the teachers were telling us it was a lockdown," she said. "It was a little bit freaky."
Students were temporarily barred from leaving both the high school and nearby C.W. Stanford Middle School for their safety, D'Annunzio said.
Buses took students from the campus to a church, where their parents waited to collect them.
A window at the school was shot out, but D'Annunzio did not know if the shattered glass caused the boy's minor injuries.
Hillsborough is in the Raleigh-Durham area of north-central North Carolina.