HARRISBURG – After months of debate, the state Senate approved a bill shortly after 5 p.m. to ban smoking in public places, clearing the last major hurdle for the legislation to finally become law.

The bill, which also allows Philadelphia to keep its two-year-old ban on the books, will now be sent to Gov. Rendell, who has said through a spokesman that he intends to sign it.

The bill effectively calls for banning smoking in all public places, but it contains a lengthy list of exemptions for certain workplaces and entertainment venues. They include bars that have 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 - though Philadelphia's law prohibits its two casinos from allowing any smoking, and the legislation passed today 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 signed by Rendell, Pennsylvania will join almost three dozen other states with smoking bans, including New Jersey, Delaware and New York.