Detroit auto executives on Friday unveiled the final details of a merger that would create the world’s largest automaker by sales, an acquisition that could create a new global leader in electric vehicles.

Tesla said in a statement that it had agreed to buy General Motors, the world leader in the production of large vehicles, for $1,222 billion, a price that would be below the $1 trillion price tag Tesla has asked for.

GM said it was buying for about $1 billion less than what the deal had previously offered.

Ford said it would acquire Fiat Chrysler Automobiles for about half its value.

GM shares fell as much as 5% on Friday.

Tesla CEO Elon Musk said the deal would create “the largest, most efficient, most affordable, most capable and best-performing vehicle maker in the world” and would enable Tesla to “build a future of competitively priced electric vehicles.”

“Tesla is in the right place at the right time for us to deliver the transformative change that will transform the way we drive, build, and consume our vehicles,” Musk wrote in a blog post.GM Chief Executive Mary Barra, the most powerful woman in American business, said the $7 billion offer from Tesla would give the automaker a greater share of the $40 trillion market for electric vehicles and reduce its dependence on foreign automakers.

GM is in talks with Tesla about a similar deal, Barra said in an interview.

GM has been working with Tesla on a battery deal that could make the automakers a “single, unified player,” Barra added.

“The opportunity for us, as a single player, is really significant.”

Ford CEO Mark Fields said the transaction was “the right move.”

“This transaction is a strong indication that GM will not only play a key role in the transformation of the U.S. automotive industry, but will also be a leader in bringing electrified vehicles to consumers around the world,” Fields said in the statement.

Ford, whose global car sales have been falling over the past few years, said it had been in discussions with Tesla since May, when it was the subject of a $10 billion takeover offer from Ford.GM and Ford were already part of a partnership that also includes Ford, Fiat Chrysler, and Volkswagen.

GM and Ford share about 70% of the company’s stock.