A 6-year-old boy whose throat was slashed by his mother in April collapsed while standing in line for lunch at his Bronx school Friday and died, police and sources said.

It was the child’s second day at PS/MS 5 Port Morris, according to a school staffer.

Cops were called to the school on Jackson Avenue around 11:40 a.m. for an unresponsive child, police said.

The boy, whose identity was not released, was found unconscious in the crowded school cafeteria, authorities said. He was rushed to Lincoln Medical Center in critical condition and was later pronounced dead.

City Schools Chancellor Richard Carranza went to the hospital, where he talked to community members and school staffers.

Police and law enforcement sources say the boy suffered a medical episode that included foaming from the mouth.

It’s believed that the boy died from a pre-existing injury, a source said.

Another source said the wound that the child suffered on his neck in April was not totally healed.

He was not living with his mother; she has been in jail since the April attack.

“They called a ‘Code Blue’ over the intercom, and they were trying to resuscitate the kid,” a school staffer told The Post, adding that it was pizza day at the school.

Fifth-grader Jason Nunez, 11, said the boy “was getting his lunch, and suddenly he just passed out.

“He hit his head. The blood was coming out of his mouth,” Nunez said.

Another employee at the school said the boy “suddenly collapsed. … We don’t know what happened.”

The victim, as well as his 2-year-old sister, had their throats slashed with a box-cutter by their 24-year-old mom, Shanice Martin, on April 27 on a Bronx street corner, police have said.

Martin had left the children bleeding and later showed up at the 42nd Precinct station house covered in blood and allegedly holding the same blade she used on her children when she confessed to the crime.

“Go ahead and arrest me,” Martin said at the time, according to sources.

Martin, who family members have said was homeless and struggled with mental health problems, was hit with a slew of charges including assault, child abandonment and child endangerment for the April 27 incident. She remains remanded without bail.

On Friday, Danielle Keane, the principal of PS/MS 5, sent home a letter to children’s parents informing them that a student “passed away” after falling unconscious during lunch.

“Several students witnessed what occurred,” the letter read. “We know how devastating this news is for our school community. Our school crisis team is available to provide support for students and staff as needed.

“We are saddened by this loss and are here to assist our school community in any way we can.”

Parents of children at the school were stunned by the boy’s sudden death.

“I’m shocked. My third-grader told me, ‘Mommy, I don’t want to go to school anymore.’ He’s scared,” said Janice Rodriguez, 34, a mom of two.

Police said the city Medical Examiner’s Office will determine the boy’s cause of death.

Additional reporting by Alex Taylor, Stephanie Pagones, and Larry Celona