Tesla wasn't identified by name in the bill, sponsored by a Montgomery County lawmaker, but it was tailored specifically for the California automaker, which has gained attention both for its battery-powered luxury sedans and its unconventional direct-to-customer sales strategy, the focus of a brutal slugging match with traditional car dealers.
"This was a means to provide the consumer with another option and it would be a positive addition to the marketplace in Pennsylvania as a result of providing that option," said Nathan Spade, a senior aide to the sponsor, Sen. John Rafferty, a Republican and chairman of the Senate Transportation Committee.
Tesla's worldwide sales last year amounted to about 25,000 cars. This year, it's aiming for 35,000. Total car sales in the United States alone topped 15 million last year.
But the approval in Pennsylvania comes at a time when other states have turned into battlegrounds, with Tesla pitted against traditional dealerships that believe the automaker's sales strategy could be a blueprint for their demise.
Along with New Jersey, Tesla has been frozen out of at least four other states: Texas, Maryland, Virginia, and Arizona.
The company operates information "galleries" in those states where potential customers can learn about the cars, but employees can't sell them or talk about pricing.
Pennsylvania law bars carmakers from opening their own dealerships, but the Board of Motor Vehicle Manufacturers, under the State Department, licensed Tesla's King of Prussia store in May 2013. It wasn't clear how closely regulators had scrutinized that license application or whether they erred by approving it.
Ronald Ruman, a Pennsylvania State Department spokesman, said Tesla's application here didn't raise any red flags. "[The process] was set up to deal with traditional dealerships," Ruman said.
He said the passage of Rafferty's bill resolved the issue. Had it not passed, he said, Tesla might have run into complications when it tried to renew its King of Prussia store license or open more stores.
Only two House members voted against the bill - Reps. Mark Gillen (R., Berks) and Daryl Metcalfe (R., Butler) - both small-government conservatives.
Gillen said his vote had "nothing to do with the car they're producing." Instead, he said singling out a company for special treatment goes against his free-market values.
Diarmuid O'Connell, Tesla vice president of business development, cited the support of Pennsylvania auto dealers to explain how the company won approval to keep selling cars in the state.
The Pennsylvania Automotive Association - a roughly 1,000-member trade group for car dealers - supported the exemption for the company, according to a memo Rafferty circulated.
That group's support stands in contrast to the reaction from New Jersey car dealers. There, the state Motor Vehicle Commission recently passed a rule bolstering the law that prohibits car manufacturers from obtaining a license to sell cars directly, effectively ending Tesla's sales at its two stores in the state, which traditional car dealers favored.
Tesla has challenged the rule in state court.
The company blamed Gov. Christie for the regulation, accusing him of caving under pressure from car dealers. A bill under consideration in the Legislature would allow Tesla to resume sales at its stores.
O'Connell called rules like the one that ended Tesla's sales in New Jersey protectionist and accused dealerships there of trying to keep the market to themselves.
Jim Appleton, president of the New Jersey Coalition of Automotive Retailers, said New Jersey car dealers resisted Tesla's entrance to the market not to stifle consumer choice, but to protect the public and enforce laws governing dealer licensing.
Traditional dealers profit from carrying out recalls of unsafe cars. Manufacturers have no such incentive, he said.
"The advocates of the Tesla exemption seem to confuse very different public-policy agendas. One is consumer choice; the other is consumer protection," he said.