Toyota Motor Corp (NYSE:TM) and Mazda Motor Corp (TYO:7261) are planning to build a new plant in the US, with hopes to open in 2021.

To create the tie up, both companies will take small stakes in each other. Toyota will have a five percent share of Mazda whilst Mazda will take a 0.25 percent share of Toyota.

The final location has not yet been picked but both car manufacturers hope the plant will build 300,000 vehicles annually and employ 4,000 workers.

Toyota has been creating alliances with Japanese rivals for years. It already has a 16.5 percent stake in Subaru Corp (TYO:7270).

Mazda has also worked closely with other car manufacturers. The manufacturer was once in a long-running alliance with car-maker Ford (NYSE:F). The relationship ended in 2008.

“For a technology company which lacks the expertise in making cars, Mazda could look like a very interesting acquisition. They’re very good, they’re not too expensive. Maybe Toyota realizes this,” said Chris Richter, analyst and managing director from CLSA.

“By buying a 5 percent stake, Toyota takes Mazda off the table rather than having it sit out there like a free agent which could someday be used against them.”

Analysts from Citi said: “The reported plan to build a new plant in the U.S. looks rational given that SUV capacity is tight at both companies and protectionism concerns remain. Also, amid signs that overall U.S. auto demand has peaked, building a plant via a joint venture will reduce the risk for both companies.”

The new US plant will lead to less criticism from Trump, who has attacked automakers for exporting cars from Mexico to the States. 

“Make in U.S.A. or pay big border tax,” Trump said in a post on Twitter to General Motors (NYSE:GM)