The NYPD’s top spokesman is stepping down from his post at the department — for a consulting gig in the private sector, The Post has learned.

Phil Walzak will make the announcement to his staff at Police Headquarters Thursday evening that he is leaving his position as Deputy Commissioner for Public Information, he revealed to The Post.

He will officially leave One Police Plaza on Sept. 20, and says he has a “large, exciting project” that he will soon announce.

Police Commissioner James O’Neill will make a determination on who will replace Walzak in the near future.

“Hundreds of times a day in our city, an NYPD cop does something amazing — from dazzling displays of heroism; to quiet acts of kindness; to pursuing dogged, meticulous investigations,” Walzak told The Post.

He added, “I was proud as DCPI to help share these stories with New York City, and the world. I thank Commissioner O’Neill for entrusting me with this incredible responsibility and experience — it has truly been an honor.”

Walzak, who previously served as campaign manager, senior advisor and press secretary for Mayor Bill de Blasio, joined the NYPD last March, replacing Stephen Davis.

Before coming on to the NYPD, Walzak worked as de Blasio’s press secretary from 2014 to 2015, and as senior adviser for Strategic Planning in his office from 2015 to 2016.

Walzak told The Post that he has no plans of working for any 2020 presidential candidate, which includes de Blasio, who failed to qualify for the latest round of Democratic presidential debates.

When Walzak, 42, took over the NYPD press office, he was met with backlash by two heads of the city’s police unions for his ties to de Blasio.

“This is the clearest sign yet that the de Blasio administration thinks the NYPD’s primary mission is to serve as a political tool, not protect public safety for all New Yorkers,” Patrolmen’s Benevolent Association President Patrick Lynch said at the time.

Still, Walzak maintains that he was hired by O’Neill, with whom he developed a rapport during his time at City Hall.

O’Neill acknowledged Walzak for his service, telling The Post: “I thank Phil for the thoughtful skill and leadership he brought to DCPI.

“The NYPD benefited enormously from his judgment, strategic creativity and principled counsel, and I wish him all the best in his next chapter.”

Under Walzak’s 18-month watch as top NYPD spokesman he faced a series of high-profile events, including O’Neill’s recent controversial decision to fire officer Daniel Panteleo over the 2014 chokehold death of Eric Garner, the slaying of Bronx teen Lesandro Guzman-Feliz and the friendly fire, line-of-duty death of NYPD Detective Brian Simonsen.

During his tenure with the department, a helicopter pilot fatally crash-landed atop a Midtown skyscraper, faulty pipe bombs were sent to CNN’s Midtown headquarters and top Democrats, and the bodies of two Saudi sisters were found duct-taped together along the banks of the Hudson River, making for international headlines.