An elementary-school talent show turned tragic in Queens after a parent suffering a violent seizure accidently punched a man who was trying to help him — and the good Samaritan later died, cops said.

Students had been performing at Ave Maria Catholic School in Howard Beach Thursday evening when strobe lights fired and a man was stricken by a seizure, a witness told The Post.

The man, who later identified himself to The Post only as Mario, “was biting his tongue, foaming from the mouth,” the witness said.

A grandparent, identified as Paul Trinchese, 61, of Howard Beach, tried to help Mario, who has a history of seizures, the witness said.

Convulsing uncontrollably, Mario struck Trinchese, whose granddaughter is in the same class as his son.

“I knew [Trinchese] helped me because I got calls later that night asking if I was OK and telling me I may have hit someone. But I’d be lying if I told you anything because I don’t remember,” Mario told The Post.

Trinchese returned home under his own power. Mario was treated at the scene.

That night, at about 9:20, Trinchese was at his home on 98th Street when he felt chest pains, said a law-enforcement source.

His family called 911, but he died of apparent cardiac arrest after medics arrived.

Law-enforcement sources said Trinchese had a history of cardiac trouble and it wasn’t clear if the punch caused the heart attack.