Mazda and Toyota agreed on Friday to collaborate on a wide range of areas including development of electric and connected car technologies, as well as production facilities.

Crucially, the two will also form a shared capital structure, continuing the trend of consolidation among the major automakers as they tackle changes affecting the auto industry such as automation and electrification.

The big news is the announcement of a $1.6 billion plant for the United States. Due to be operational in 2021, the plant will build Corollas for Toyota and an SUV for Mazda.

Toyota had intended to move Corolla production to a new plant in Mexico from the current site in Canada. Instead, the automaker will use the Mexican plant for additional production of the Tacoma. Production of the mid-size pickup truck will also continue at the current sites in the U.S. and Mexico.

Ford also intended to move production of its Focus to Mexico, from the U.S., but will instead start importing the cars from China.

Toyota chief Akio Toyoda (left) and Mazda chief Masamichi Kogai

Toyota chief Akio Toyoda (left) and Mazda chief Masamichi Kogai

Mazda and Toyota’s new U.S. plant is estimated to have an annual production capacity of 300,000 units. It is also estimated to have 4,000 employees at full capacity.

When it comes to technology collaboration, Mazda and Toyota say they will jointly develop electric cars. Both automakers are behind rivals in the race for affordable, mass-produced electric cars. According to reports, Toyota won’t have an offering in this segment until early next decade.

Other areas of technological collaboration will be infotainment systems and connected car technologies such as vehicle-to-vehicle (V2V) and vehicle-to-infrastructure (V2I) communication systems. The latter will be crucial for future safety technologies which the automakers hope will lead to zero accidents.

And as for the shared capital structure, Mazda and Toyota will take equal value stakes in each other. This will result in Mazda acquiring 0.25 percent of Toyota, and Toyota acquiring 5.05 percent of Mazda.

Mazda and Toyota have been discussing various collaborations since 2015. And neither company is a stranger to working with rival firms. Toyota joined with Subaru to help it develop the 86 sports car, and it is currently working on a similar project with BMW for a new Supra. Mazda, meanwhile, lent its latest MX-5 Miata platform to Fiat Chrysler for the Fiat 124 Spider. Mazda is also building the 124 Spider for Fiat at a plant in Japan. The automaker has also worked closely with Ford in the past.