The NYPD has to scrap the 36,000 smartphones it gave cops over the past two years because they’re already obsolete and can’t be upgraded, The Post has learned.

The city bought Microsoft-based Nokia smartphones as part of a $160 million NYPD Mobility Initiative that Mayor Bill de Blasio touted as “a huge step into the 21st century.”

But just months after the last phone was handed out, officials plan to begin replacing them all with brand-new iPhones by the end of the year, sources said.

The move follows Microsoft’s recent decision to stop supporting the operating system that runs the NYPD’s devices and nearly a dozen custom-engineered apps.

Law enforcement sources blamed the boondoggle on NYPD Deputy Commissioner for Information Technology Jessica Tisch, with one saying, “She drove the whole process.”

“Nobody purchases 36,000 phones based on the judgment of one person,” a source said.

“I don’t care if you’re Jesus f- -king Christ, you get a panel of experts.”

Technology experts had long questioned the NYPD’s decision to choose Microsoft-based phones over those that run on Google’s Android software or Apple’s iOS.

“The NYPD’s decision to go with Microsoft’s mobile operating system seems to confound more than a few, since Windows Phone’s 2.3 percent US market share is anemic when compared to Android’s 65.2 percent and iOS’s 30.9 percent,” read an article published on the tech news site Digital Trends in October.

CNET, the popular site for tech news and reviews, also expressed dismay at the NYPD’s choice.

“You read that right. Life and death situations rely on outdated phones running Microsoft’s Windows Phone software,” read an October report, which was posted with the headline, “This is NYPD’s official crime-fighting phone.”

The NYPD bought two models of Nokia phones: the Lumia 830, first released in October 2014, and the Lumia 640XL, which was rolled out in March 2015.

By comparison, Apple unveiled its iPhone 6 in September 2014 and has since updated its flagship product three times.

Recent reports have said Apple will launch yet another version, the iPhone 8, on Sept. 12.

Both of the NYPD phones — and their Microsoft-engineered apps — run on the Windows 8.1 operating system, which the company announced it would no longer support after July 11.

An article on Forbes marked the occasion with the declaration, “Windows Phone is dead.”

Sources said Tisch, whose late grandfather co-founded the Loews Corp. conglomerate, insisted on Microsoft-based phones in part because the NYPD was already using Microsoft software to run the video surveillance program at its Lower Manhattan Security Initiative Command Center.

“She was in charge. It was her project, no question about that,” a source said.

Even then-NYPD Commissioner Bill Bratton acknowledged Tisch’s role in the decision-making process when officials announced the smartphone plan in October 2014.

“She’s a terror if she doesn’t get her way, so I usually let her get her way,” Bratton had joked.

“So she’s certainly getting her way with this technology.”

Despite the Microsoft phones’ short shelf life, they have been hailed by both NYPD brass and the rank and file for giving cops the ability to receive alerts, search law enforcement databases, file reports and even watch in real time as 911 dispatchers type up emergency calls.

An NYPD spokesman said the department wouldn’t discuss the cellphone situation until Tisch returned from vacation Monday.

Additional reporting by Laura Italiano