In a move that would bring a smile to Clint Eastwood's face, state lawmakers on Monday voted 45-5 to approve a controversial "castle doctrine" that would allow Pennsylvanians more leeway to use deadly force against those they believe intend to harm them or their families.

The legislation, House Bill 40, is now in its way to Gov. Tom Corbett's desk. It would become law after Corbett signs it. The state senate on Monday approved the bill, introduced by Republican state Rep. Scott Perry of York County, by a 45-5 vote.

Senators Lawrence M. Farnese, Vincent J. Hughes, Shirley M. Kitchen, Christine M. Tartaglione and LeAnna Washington, all Democrats, were opposed.

"Before this bill, even in your home, if you're being attacked by an intruder, your first duty is to retreat," said Perry's Chief of Staff Dave Brinton. "What this law allows you to do, is if you are in your home, or a public place, such as a mall, or your car, you have the right to use force - up to deadly force" to protect yourself.

But Carbon County District Attorney Gary Dobias, while affirming the right of law-abiding citizens to defend themselves, has reservations.

"It's somewhat controversial, and I do have some concerns. One is that Pennsylvania already has a castle doctrine. There is no duty to retreat if you are in your home. (Under the proposed law), there's no longer a duty to retreat, even out on the street, even if you could do so safely," he said

Dobias also said the bill could escalate gun violence.

"I'm concerned the new law is going to encourage a deadly confrontation, even if the victim could safely leave," he said. "I'm afraid we're going to see criminals using the new law to try to justify violent conduct, for example, street gangs," he said. Dobias worries the law would create a "shoot-first-ask-questions-later type of situation."

However, state Sen. David G. Argall supports the bill, which would also expand the definition of "home" to include porches, patios and attached decks. It also makes it tougher to use the law as defense of criminal activity, Perry has said.

"This legislation is a common sense reform to benefit law abiding citizens," Argall said. "House Bill 40 would allow citizens to protect themselves and their family while in their home or vehicle. Citizens should not need to worry about using force to prevent an intruder from illegally entering their home, especially when it jeopardizes families."

Under the proposed law, "an actor is presumed to have a reasonable belief that deadly force is immediately necessary to protect himself against death, serious bodily injury, kidnapping or sexual intercourse compelled by force or threat if both of the following conditions exist: The person against whom the force is used is in the process of unlawfully and forcefully entering, or has unlawfully and forcefully entered and is present within, a dwelling, residence or occupied vehicle; or the person against whom the force is used is or is attempting to unlawfully and forcefully remove another against that other's will from the dwelling, residence or occupied vehicle."

Further, the bill states that "the actor knows or has reason to believe that the unlawful and forceful entry or act is occurring or has occurred; the person against whom the force is used has the right to be in or is a lawful resident of the dwelling, residence or vehicle, such as an owner or lessee; the person sought to be removed is a child or grandchild or is otherwise in the lawful custody or under the lawful guardianship of the person against whom the protective force is used; the actor is engaged in a criminal activity or is using the dwelling, residence or occupied vehicle to further a criminal activity; or the person against whom the force is used is a peace officer acting in the performance of his official duties and the actor using force knew or reasonably should have known that the person was a peace officer."

Versions of the proposed law have wending their way through the legislative process for years. Last year, then-Gov. Ed Rendell vetoed one version, contending that it would result in more gun violence.