Airbnb, the popular online platform for renting out couches and spare rooms, is earning tens of millions of dollars off illegal listings in New York City, the state attorney general said Thursday.

In a new report based on an examination of 35,354 short-term rentals on the site between January 2010 and June 2, 2014, attorney general’s office found that 72 percent of the listings flouted local laws, all the while helping Airbnb to earn nearly $40 million.

“Commercial users,” which controlled more than 10 different apartments, were also making a bonanza off Airbnb listings, earning some $59.4 million in revenue, the report said. The attorney general’s office also said “numerous units appear to serve as illegal hostels.”

“This report raises serious concerns about the proliferation of illegal hotels and the impact of Airbnb and sites like it on the city of New York,” Attorney General Eric Schneiderman said in a statement.

The report also found that Airbnb listings are concentrated in “gentrified neighborhoods” like Greenwich Village, SoHo and Chelsea, while less than three percent are found in Queens, the Bronx and Staten island.

A spokesman for Airbnb said in an email that the report’s conclusions relied on “incomplete and outdated information.”

“The findings do not account for the more than 2,000 listings we have already removed from our community in New York,” said spokesman Nick Papas. He said the company has been advocating for "clear, fair rules for home sharing."

“We’re proud that Airbnb has helped countless families pay their bills and stay in their homes,” he continued. “Now, we need to move forward. … We need to work together on some sensible rules that stop bad actors and protect regular people who simply want to share the home in which they live.”

Airbnb, which has been valued at more than $10 billion, has been waging a public relations battle — even posting ads in subway stations and hiring lobbyists — as it faces challenges from local lawmakers, housing activists, the hotel industry and others.

Critics of Airbnb have long argued that by allowing New Yorkers to flout laws that limit short-term rentals, housing is being taken off the market and exacerbating the city’s affordable housing crisis.