Mere hours after Gov. Andrew Cuomo signed legislation setting harsh penalties for Airbnb hosts who break local housing regulations, attorneys for the popular website platform marched into federal court to challenge the new law.

The legislation authorizes municipalities to fine owners or tenants up to $7,500 if they rent their property for fewer than 30 days and aren’t present during the guest’s stay.

Cuomo signed the bill Friday in the wake of intensive lobbying on both sides of the issue. The bill passed both the Democratic-led Assembly and the Republican-led Senate in June with strong support from the hotel industry.

“For too long companies like Airbnb have encouraged illegal activity that takes housing off the market and makes our affordability crisis worse,” said Manhattan Democratic Sen. Liz Krueger, who co-sponsored the legislation.

Airbnb critics also argue that it harms neighborhoods by encouraging a steady stream of transients.

No sooner had Cuomo signed the bill than Airbnb filed a federal lawsuit against state Attorney General Eric Schneiderman and Mayor Bill de Blasio,  The New York Times reported.

“The company contends that the law violates the company’s constitutional rights to free speech and due process, as well as the protection it is afforded under the Communications Decency Act, a federal law that says websites cannot be held accountable for content published by their users,” the lawsuit states.

Airbnb charges a service fee to renters and takes a cut of the owner’s or tenant’s revenue when a room or a home is booked. Airbnb supporters say it helps them make extra money. Some say the extra income is critically important to their ability to afford their residence.