Former President Donald Trump will attend the private funeral planned for Thursday of firefighter Corey Comperatore, who was killed during the assassination attempt against him last weekend, The Post has learned.

Comperatore was supporting Trump at the Saturday campaign rally when shots rang out from a nearby rooftop in Butler, Pa.

A shooter nicked Trump’s right ear, killing Comperatore, and severely wounded two others.

That suspect, identified as Thomas Matthew Crooks, was killed.

Asked whether Trump would attend the father of two’s funeral one week after surviving the assassination attempt, a source close to the former president told The Post, “of course he is.”

Earlier this week, Trump called the Comperatore’s wife to convey his condolences.

“He was very kind and said he would continue to call me in the days and weeks ahead,” Helen Comperatore wrote of the former president on Facebook. “I told him the same thing I told everyone else. He left this world a hero and God welcomed him in. He did not die in vain that day.”

Compatore was the former fire chief of the Buffalo Township Volunteer Fire Company in Sarver, Pa.

GoFundMe campaign for Comperatore’s wife had raised more than $1.2 million in the days since the firefighter’s death.