HARRISBURG - A bill that would authorize the state to assume nearly full authority over the City of Harrisburg - the first such intervention in modern Pennsylvania history - cleared the legislature Wednesday, and Gov. Corbett is expected to sign it.

By a 177-18 vote, the state House gave final approval to legislation aimed at addressing the fiscal woes of the capital city and ending the feuding among municipal officials that has paralyzed attempts to turn around this struggling community of 50,000.

"Harrisburg's fiscal condition is dire, and the inability of its elected leaders to agree on a recovery plan has forced the state to intervene," said State Rep. Glen Grell (R., Cumberland), one of the legislation's authors.

The vote represents the latest distress signal for Pennsylvania's beleaguered smaller cities as they try to ride out the recession amid shrinking revenue and rising costs.

"This is a historic moment," said G. Terry Madonna, a pollster and political analyst at Franklin and Marshall College. "I don't know of another time that a city has filed for bankruptcy, and I don't know of another time that the state has taken over a municipality."

The legislation (S.B. 1151) would allow the governor to declare a state of fiscal emergency and appoint a receiver with decision-making powers in cases where cities such as Harrisburg fail to adopt their own recovery plans.

Sponsored by Sen. Jeffrey Piccola (R., Dauphin), whose district includes the capital, the bill was in response to the Harrisburg City Council's rejection of a financial-recovery plan presented to it under Pennsylvania's Municipalities Financial Recovery Act, known as Act 47.

Opponents warned the legislation could violate the state Constitution by usurping the authority of local elected officials.

"I would say it overreached," said State Rep. Robert Freeman (D., Northampton), who represents Easton, one of 53 "third-class" cities the bill would cover. In the language of state law, third-class cities are every city in Pennsylvania other than Scranton, Pittsburgh, and Philadelphia.

"The state authority could apply to other third-class cities, when its intent was to address Harrisburg-specific problems," Freeman said.

Under the legislation, once the governor declares a state of emergency, he would direct the secretary of the Department of Community and Economic Development to issue an emergency action plan within 10 days to ensure that vital services, such as police and fire protection, continue.

In 30 days, if there is no agreement between the city and the state on a financial-recovery plan, the governor could petition a court to approve a receiver who would then authorize a recovery plan and force the city to implement it.

At the same time, the state is working to block a bankruptcy petition filed in federal court by the divided City Council.

Harrisburg Mayor Linda Thompson, who took office in 2010, said in a statement Tuesday that, although she did not support the takeover legislation, she would "work diligently with all parties involved in the recovery process moving forward."

A hearing on the bankruptcy petition, which council members filed over her wishes, is scheduled for Nov. 23.

At the core of Harrisburg's financial woes is the city's $300 million debt, largely tied to its failed attempt under the previous mayor, Stephen Reed, to turn its troubled incinerator into an income-generating resource.

The city entered into the Act 47 agreement with the state in order to stave off bankruptcy, but the majority of council opposed the plan, which included sale of the incinerator and parking garages. Council members contended the plan didn't go far enough.

Though Harrisburg may be closest to bankruptcy, it is hardly alone in facing dire financial straits. Seventeen other Pennsylvania cities are currently deemed "financially distressed." Philadelphia, Pittsburgh, and Chester are among cities already under varying degrees of state fiscal supervision, though none as extensive as the controls described in the new bill.

The state Supreme Court ruled Wednesday that Scranton's Act 47 status did not spare it from having to pay arbitration awards to police and fire union members.

Moody's Investors Service recently lowered credit ratings for two counties and warned Tuesday that it might have to downgrade Bucks County's AAA rating.

Contact staff writer Amy Worden at 717-783-2584, aworden@phillynews.com,

or @inkyamy on Twitter.

Inquirer staff writer Joseph N. DiStefano contributed to this article.