On Friday, Toyota Motor Corp. and Mazda Motor Corp. signed a deal to enter into an alliance. As part of the plan, the pair will build a new factory in the US and develop new electric vehicles and connected car and autonomous driving systems. Each company will purchase five percent of the other's shares.

In May 2015, the two companies entered into a partnership to explore avenues of mutual benefit, sharing complementary technologies. This new deal strengthens that partnership.

The site of the new $1.6 billion US factory is yet to be determined, but it's planned to be an equal venture between Mazda and Toyota. The site will employ up to 4,000 workers and produce around 300,000 vehicles a year starting in 2021. Mazda says it will produce CUVs for the North American market at the new plant, and Toyota will use it to build Corollas. As a result, Toyota's new factory in Mexico will instead shift to production of the Tacoma pickup truck instead.

"The greatest fruit of our partnership with Mazda is that we have found a new partner who truly loves cars. It has also sparked Toyota’s competitive spirit, increasing our sense of not wanting to be bested by Mazda. This is a partnership in which those who are passionate about cars will work together to make ever-better cars. It is also the realization of our desire to never let cars become commodities," said Toyota President Akio Toyoda.

Mazda President and CEO Masamichi Kogai was similarly enthusiastic about the deal, saying, "Nothing would please me more than if, through this alliance, we can help to energize the auto industry and create more car fans by bringing together two competitive spirits to spur each other on, leading to innovations and fostering talent and leaders."

The collaboration on new EVs is a particularly big win for Mazda. As a relatively small car company, it has lacked the resources to develop its own EVs thus far. Toyota, on the other hand, has a wealth of experience with hybrids thanks to the Prius, and it has also dipped its toe into other alternative powertrains with the hydrogen-powered Mirai sedan.