Tesla Motors can keep selling its pricey electric vehicles directly to New Yorkers at its five current locations, including two on Long Island, under an accord that Gov. Andrew M. Cuomo announced Friday.

Car dealers had tried to block Palo Alto, Calif.-based Tesla, whose Model S starts at about $71,000, from bypassing them. Legislation had been introduced in the Assembly and State Senate that would have barred new automobile manufacturers such as Tesla from selling cars directly to the public.

Car dealers argued the prohibition is needed to ensure that consumers can negotiate lower prices by shopping around different franchises and still get their cars serviced if carmakers go out of business.

But Tesla, whose sticker prices are the same in all 50 states, counters that its direct-sales model benefits consumers because dealers are just middlemen whose profits come out of consumers' pockets.

The new compromise would allow Tesla, which hopes to offer a more affordable $30,000 model in four years, to open more locations in New York, but it must abide by "a strengthened dealer franchise law," the Cuomo administration said, without elaborating.

Tesla's new stores could be opened as franchised dealerships, according to a source familiar with the accord.

Car dealers recently won a round in New Jersey, where the Motor Vehicle Commission approved a rule banning Tesla's direct-sales strategy. This will force the company -- unless it opts to fight in court -- to turn its showrooms into galleries, where sales staff is barred from offering test drives or discussing prices or purchase instructions.

Get the Breaking News newsletter! Get the latest breaking news as it happens. By clicking Sign up, you agree to our privacy policy.

"It's a very suboptimal way of operating -- who doesn't want to test-drive a car before buying it?" asked Diarmuid O'Connell, Tesla's vice president of corporate and business development.

Mark Schienberg, president of the Greater New York Automobile Dealers Association, said giving customers the best deal is best accomplished by having competing dealers.

"You go from dealer to dealer, working out the best price," he said. "If you're dealing with a monopoly, the way Tesla is . . . they can raise the price to whatever they want to raise it."

But Tesla argues that it gives customers the best deal by charging uniform prices, which are posted on its website. "We don't believe in taking advantage of the customer by taking advantage of information arbitrage, as happens in the traditional dealer haggling process," said O'Connell.

Tesla paid lobbyists $167,500 in New York State from May 2013 to February 2014 to advance its positions, according to Joint Commission on Public Ethics records. The Greater New York Automobile Dealers Association paid lobbyists just under $250,000 from January 2013 to February 2014, the records show.

Tesla has stores and galleries in 21 states, a spokeswoman said. New York drivers have registered more than 600 Teslas, and O'Connell said the company hopes to build a "mass movement" toward electric cars in the next few years with the lower-priced model.

State laws run the gamut from California, where Tesla's direct sales are permitted, to Texas and Arizona, where they are forbidden, according to O'Connell.

With Yancey Roy and

Tom Incantalupo