A video prank for “The Walking Dead” in which actors playing zombies lurked beneath a subway grate and scared New Yorkers is under investigation by city officials, authorities said.

“We are deeply troubled by this video,” an MTA spokesman said Sunday. “We have forwarded it to the NYPD and are also conducting our own investigation.”

The video promoting AMC’s hit postapocalyptic zombie-invasion series — which returned to the air with new episodes Sunday — was posted to YouTube Wednesday and garnered more than 3.1 million views.

The clip shows people shrieking and bolting as “zombie” hands suddenly claw at them through a sidewalk subway grate on 14th Street at Union Square.

It also shows preparation for the video shoot from the previous night, in which crews pry open and climb into the grate under cover of a lighted tent.

The Manhattan ad agency that staged the stunt did not have permission, WPIX reported, although police and transit officials told The Post they are still trying to determine if that’s the case.

H. Tony Berger, CEO and founder of Relevent, the NYC ad agency that made the film, defended his work.

“I can’t go into specific details,” he said. “But I firmly and strongly believe that what we did — the shoo t— was executed legally and in accordance with city policies.

Cops said they hadn’t received a formal complaint from the MTA as of Sunday, a police source told the Post. But accessing subway grates and filming on city property without permits could result in charges of trespassing, criminal mischief and disorderly conduct, the source said.

The city recently has turned into a playground for professional video pranksters. Another ad agency, ThinkModo, had viral hits with two recent movie promotions.