HARRISBURG - Philadelphia would get to keep its two-year-old smoking ban, while the rest of the state would now be allowed to stamp out smoking in most workplaces under a compromise bill negotiated today by a joint committee of the House and Senate.

The compromise came after months of protracted debate that, at times, threatened to derail the measure.

The bill approved today will now be sent to the full membership of the House and Senate. Lawmakers are not allowed to amend it - they can only render a yes or no vote.

Both the Senate and the House could consider it as early as tomorrow.

Gov. Rendell, through a spokesman, called the bill a "major step forward," and said he would sign it.

"The governor urges both houses to take up the bill as quickly as possible and get it to his desk so we can start protecting Pennsylvanians from the ill effects of secondhand smoke," Rendell spokesman Chuck Ardo said today.

Rendell had said in the past that he would not support any legislation that would prevent Philadelphia from keeping the smoking ban it passed in 2006.

Today's compromise allows the city to keep that law. The rest of the state's municipalities would fall under the joint committee's compromise bill.

That bill effectively calls for banning smoking in all public places, but it does contain a lengthy list of exemptions for certain workplaces and entertainment venues. They include bars that do 20 percent or less in annual sales of food, as well as cigar bars, tobacco shops and private clubs whose officers agree to it.

Casinos would be permitted to allow smoking in up to 50 percent of their gaming halls - although Philadelphia's law prohibits its two casinos from allowing any smoking, and today's legislation will not change that.

Also excluded under the proposed statewide ban: private homes and other residences and vehicles, unless they are being used for child-care services; and long-term care facilities, as well as residential facilities used for drug and alcohol rehabilitation and mental-health services.

Hotels would be permitted to allow smoking in up to 25 percent of their rooms.

Smoking would also be allowed in designated outdoor smoking areas at sports or recreation facilities, theaters, and other performance establishments.

If the bill is approved, Pennsylvania will join almost three dozen other states with smoking bans, including New Jersey, Delaware and New York.

Thirty-two states and the District of Columbia have enacted some kind of smoking ban, although they vary in how strict they are, according to the National Conference of State Legislatures.

About two dozen of those states have tougher laws that ban smoking in almost all public places, including bars. Still, Pennsylvania's proposed ban would prohibit people from lighting up in many workplaces where they are now free to do so, including restaurants outside of Philadelphia and small, private companies where people can smoke in their offices.

Sen. Charles McIlhinney (R., Bucks), who was instrumental in crafting the compromise, said today that he believes that Pennsylvania's proposed ban is strong and has a good chance of being approved in the Senate.

"There were a lot of different issues at play . . . but in the end, everyone wanted to see a smoking ban in effect," he said.

Some smoking-ban advocates tentatively gave the bill a good review.

"It's definitely a step forward for this state," said William T. Godshall, executive director of SmokeFree Pennsylvania, though he pointed out that almost two dozen other states have tougher laws that prohibit smoking in most bars.

The American Lung Association of Pennsylvania was critical of the bill and did not endorse it. The Pennsylvania division of the American Cancer Society also stopped short of endorsing it, though it called the measure a "good first step."

Rep. Michael Gerber (D., Montgomery), a committee member who had pushed for a more stringent ban, said today's compromise "isn't as restrictive as I would have hoped . . . but I am pleased with the final outcome."

Sen. Stuart J. Greenleaf (R., Montgomery), who had advocated for a bill with no exemptions, described the compromise this way: "That's democracy, and that's the way the process works."

Still, one key lawmaker on the joint committee voted against the proposed measure.

Senate Minority Leader Robert J. Mellow (D., Lackawanna) opposed it because it does not allow other municipalities and counties that had enacted smoking bans in the past - only to be thwarted in the courts - from reinstating their laws.

That includes Allegheny County, which passed a county-wide ban that was struck down last year in Commonwealth Court.

Mellow said that the committee was "holding hands and singing 'Kumbaya'," while effectively telling Allegheny County residents "the hell with you."

"We're ignoring the second-largest county in the state," he said, "yet we're here patting each other on the back."

Contact staff writer Angela Couloumbis at 717-787-5934 or acouloumbis@phillynews.com.