The city is literally selling itself.

Public streets and sidewalks are routinely sold to institutions and deep-pocketed real estate interests in a little-known practice that takes them off the official City Map and transforms them into private property. The city got more than $35 million from nine street deals in the past four years, according to the Law Department.

Massive real estate firm Tishman Speyer owns a company that spent $25 million — the largest purchase since July 2013 — on a single block of West Street in Queens for a Long Island City luxury housing project.

Five other recent buyers are obscure limited-liability companies, including one owned by the powerful Durst Organization, which purchased two waterfront streets in Queens for $1 million in 2015.

New York University also bought two blocks of sidewalks on Mercer Street and some underground space in Greenwich Village for nearly $6.4 million as part of its controversial expansion plan.

Once the real estate is sold, developers, with city approval, can create pedestrian promenades, or in some instances build on the land.

City officials describe the sales as a routine way to make money and unload useless land, but critics of Mayor Bill de Blasio’s affordable-housing plans panned the process.

“It’s morally outrageous and wrong that the de Blasio administration is selling public streets to greedy developers and shadowy LLCs and getting no real affordable housing in return,” said Jonathan Westin, head of the left-wing New York Communities for Change. “These are atrocious giveaways to real estate companies simply looking to reap big profits.”

Studios at the Tishman Speyer development start at $2,197 a month. The project is under construction and includes no affordable housing, according to a Tishman Speyer spokesman who declined to comment further.

The two Queens streets purchased by the Durst Organization will be used for a waterfront esplanade as part of the company’s Halletts Point development, where about a quarter of the units will be affordable.

“We paid the city $1 million to open up and fix and maintain their streets so the community has access to waterfront,” Durst spokesman Jordan Barowitz said.

Still, Westin said, “Any sale of scarce and valuable public land should clearly require developers to build 100 percent permanently affordable housing for low-income and homeless New Yorkers.”

Developers and others apply to buy streets and they’re removed from the City Map if approved. Some only buy sidewalks, still considered part of a city street.

The City Planning Commission has to approve any de-mappings and they must also go through the land-use review process. Several agencies like the FDNY must OK the plans.

“This is a multi-agency effort whereby vacant city-owned land is put to better use,” Law Department spokesman Nick Paolucci said. “Land has been used to build affordable housing and other betterments for the community. That means more properties added to the city tax rolls.”