The Senate voted 32-17 to approve the bill one day before layoff notices were to be sent to nearly 3,000 employees of Pennsylvania's largest city, including more than 850 police officers and firefighters.
The bill authorizes the city to increase its sales tax from 7 percent to 8 percent for five years and stretch out its pension contributions to generate $700 million to balance its budget. Without that authority, city services would be slashed and the layoffs would take effect Oct. 2.
The bill was tied up for more than three weeks by a disagreement between the House and Senate over provisions that would have changed the state's municipal pension laws. On Thursday, the Senate ended the standoff by accepting the House version.
An obviously relieved and happy Mayor Michael Nutter advised his Cabinet in a conference call that the bill had passed and what he once described as his "doomsday" plan had been canceled. At a news conference, he thanked legislators for their support.
"We're trying our best to handle our business in Philadelphia, but every now and then we do need some help," Nutter said, describing the changes in the bill as "legislative tools" to fix city finances.
Rendell, who was credited with rescuing Philadelphia from the verge of bankruptcy during his own two terms as mayor in the 1990s, is likely to sign the legislation, said spokesman Gary Tuma.
Nutter, a Democrat in his first term, had personally led the city's sizable lobbying team at the Capitol.
The mayor had warned that the layoffs - the largest-ever reduction in a work force that currently totals more than 20,000 people - would be unavoidable if the state failed to step in.
"You have to deal with the human aspect of all this," Nutter said. "These are not just names on a sheet of paper. These are not numbers on a document. These represent real people and real lives and real service."
On the conference call, city police Commissioner Charles Ramsey said, "I don't even want to think about what would have happened, had this not gone through."
In a brief debate preceding the vote, Sen. Jim Ferlo criticized the House amendment that watered down many of the municipal-pension provisions the Senate wanted, including a mandatory freeze on pension benefits for current employees and reduced benefits for new hires for funds with the most serious financial problems.
Too many policymakers "want to buy the world an ice cream cone with no money to pay for it," said Ferlo, D-Allegheny, who said he voted for the bill largely because of the help it provides to Philadelphia.
The Senate provisions had drawn strong opposition from organized labor groups, whose leaders joined House Democratic leaders at a news conference celebrating the bill's passage.
Associated Press writer Patrick Walters in Philadelphia contributed to this story.