Airbnb is now legal — and taxable — in Philadelphia.

A law allowing short-term home and room rentals in the city went into effect on Wednesday. They’ll be taxed at the 8½-percent hotel rate.

City council unanimously passed sweeping home and room rental reforms.

Along with the tax, the law adjusted zoning rules that made most rentals illegal in residential areas. A city license is required for rentals lasting more than 30 days.

City Councilman William Greenlee says Airbnb-type rentals are essentially short-term hotels and should be made to follow the same rules.

The rentals had been operating tax free in an unregulated black market.

The city expects thousands of rentals through Airbnb and similar online marketplaces for Pope Francis’ visit in September and the Democratic National Convention next year.