Alleged Parkland, Florida, school shooter Nikolas Cruz spent an entire court hearing resting his forehead on a table — as his lawyers tried to block the release of the first statement he made to police following the Valentine’s Day massacre that killed 17 people.

The 19-year-old gunman appeared bored or exasperated in court Monday as lawyers for the Associated Press and other outlets argued that the statement should be made public.

But Cruz’s attorneys want the statement suppressed — saying it would improperly influence jurors.

His lawyer David Frankel said “98 percent” of the statement contained some element of a confession and would make it impossible for Cruz to get a fair trial.

“The right of access is not absolute, but the right to a fair trial is,” Frankel said. “This court’s obligation is to go to whatever lengths are necessary to see he gets a fair trial.”

Media lawyer Dana McElroy argued the only portions that should be suppressed were any comments that appeared to be a substantive confession but not the whole statement. Prosecutors said the statement was heavily redacted and ready to be released to the public.

“The coverage of this case will and should continue. It’s important to the public and to everyone who’s watching this case that all of the facts be reported,” McElroy said. “There’s a great public concern about how this case is handled.”

Cruz’s lawyers also don’t want the public to see a 70-page report from Broward County school officials detailing their client’s educational record. Cruz had many behavioral problems and was eventually expelled from Marjory Stoneman Douglas High School.

Broward Circuit Judge Elizabeth Scherer didn’t immediately make a decision.

Cruz faces the death penalty if convicted in the attack on Stoneman Douglas High School that also wounded 17 others.

His next court date is Aug. 15.

With Post wires