Airbnb, the online marketplace where people can list their homes for short-term rentals, has agreed to collect Pennsylvania's 6 percent hotel occupancy tax and remit proceeds to the state, beginning July 1.

"The agreement with Airbnb places Pennsylvania at the forefront of states responding to the sharing economy and will help level the playing field across the lodging industry," Gov. Wolf said.

The hotel occupancy tax applies when renting out a property - including a house, room, or apartment - to a guest for periods of less than 30 days.

Airbnb will collect and remit the state tax on behalf of hosts and guests, said Revenue Department Secretary Eileen McNulty.

The agreement, expected to generate nearly $1 million annually for the state's general fund, comes ahead of the Democratic National Convention next month, when scores of rentals through Airbnb are expected to be booked by visitors.

In Philadelphia, a law took effect last July that legalized short-term rentals through Airbnb and other entities, such as Craigslist.

They previously operated outside the legal sphere, said City Councilman William K. Greenlee, who introduced a bill to regulate and tax short-term rentals.

"Airbnb came to us and said, 'We want to be legal.' With that came the responsibility of paying the hotel tax," Greenlee said.

The city began collecting the 8.5 percent occupancy tax, paid by renters staying in homes, on July 15. The additional tax revenue generated was $1.2 million through May 31.

The city hotel tax proceeds are split between the Philadelphia Convention and Visitors Bureau, Visit Philadelphia, and the Convention Center.

Pennsylvania also collects a 1 percent local hotel tax in Philadelphia and Allegheny County, which is remitted to those counties, the state said.

Airbnb said it taxes rentals in Connecticut, Rhode Island, Illinois, Florida, North Carolina, South Carolina, Alabama, Louisiana, and Oregon, and in more than 150 cities and counties globally.

San Francisco-based Airbnb collects at the point of sale on its website.

Airbnb said it has 8,370 active rental listings in the Philadelphia metropolitan area, which averaged 47 rental nights in 2015. Typical annual earnings for the hosts was $4,900 last year in Philadelphia, Bucks, Montgomery, Chester, and Delaware Counties.

Across Pennsylvania, Airbnb has 12,130 active listings, which averaged 40 rental nights last year. Typical annual earnings for hosts statewide was $5,000 in 2015, the company said.

"This agreement allows the state of Pennsylvania to harness the economic impact of home sharing while also making it easier for Airbnb hosts - the vast majority of whom are middle-class people sharing their own home - to comply with state tax laws," said Josh Meltzer, Airbnb regional director of public policy.

The hotel industry, which has long paid the tax, pushed for the measure, calling it a needed equalizer.

"Our hotel tax funds the Convention Center, Visit Philadelphia, and the Philadelphia Convention and Visitors Bureau," said Edward R. Grose, the Greater Philadelphia Hotel Association's executive director. "We felt that Airbnb properties benefit from those resources, so they should also pay the hotel tax."

Delegates to the Democratic National Convention will be staying in hotels "because that's where the DNC put them in," Grose said. Many others coming to Philadelphia because of the convention may choose Airbnb rentals, he said.

"Center City will be filled. Pretty much every hotel room is going to be booked July 24 to July 28," Grose said.