The Department of Education will penalize city high-school students who take part in a half-day gun-control protest Friday, according to a spokesperson.

Roughly 5,000 kids from more than 30 city schools — including top-ranked Stuyvesant HS and the Beacon School — are expected to mass at Washington Square Park at noon on Friday to call for more stringent firearms laws.

The DOE offered a reprieve to kids who took part in a brief national walkout on the issue in March after the Feb. 14 high-school massacre in Parkland, Fla., with Mayor Bill de Blasio voicing his support for the 17-minute protest.

But DOE spokesperson Miranda Barbot said Thursday that kids who take part in Friday’s walkout, which is being supported through a grant by the American Federation of Teachers, will not get any special pardon.

“We support student participation in civic engagement and advocacy, and encourage schools to facilitate opportunities for respectful discussions on current events,” Barbot said. “We are aware of the planned full-day walkout and schools will follow standard attendance policies.”

Students who leave school grounds will be cited for an unexcused absence on their record, Barbot said.

Schools Chancellor Richard Carranza, during a town hall meeting this week, also counseled students not to abandon their classes

Carranza said he supported last month’s walkout, but suggested that the gun-control issue would now be best addressed within school settings.

One of the organizers of the Friday event, Arielle Geismar, said she was disappointed by Carranza’s stance.

“The new chancellor’s words, to me, are upsetting,” the Beacon School junior told The Post.

Geismar said that the walkout in March was significant, but more action is needed to induce meaningful reforms.

“The purpose of a walkout is to disrupt the system until we are heard and understood and action is taken,” she said. “So until our demands are met, we will continue to protest — and the nation will continue to listen.”

The protest will feature survivors of the school massacres in Parkland, Newtown, Conn., and Littleton, Colo., Geismar said.

The New York City gathering — on the anniversary of the 1999 Columbine massacre in Colorado — will be one of roughly 2,200 simultaneous student rallies across the nation.

Last month’s school walkout counted more than 100,000 city-student participants.

Friday’s rally will also include addresses from AFT chief Randi Weingarten and Congressman Jerrold Nadler (D-NY), and participants are expected to criticize politicians who receive money from the National Rifle Association.

New York Senators Chuck Schumer and Kirsten Gillibrand are also expected to attend.