Ford Motor Co. and Volkswagen announced a worldwide partnership on Tuesday that’s aimed at saving the two companies millions on development of pickup trucks, vans and transit vehicles, with an eye toward working together in the future on self-driving and electric cars.

Under the alliance, each company will design and produce cars for the other. In Europe, Volkswagen will begin to sell Ford-produced medium pickups and commercial vans by 2022, and Volkswagen will develop a city-oriented van for Ford that would arrive by 2023. Each company would enjoy the flexibility to brand and market the new vehicles according to its own strategies, executives said.

The partnership is not a merger and will not involve either company taking an ownership stake in the other.

Volkswagen chief executive Herbert Diess said that the commercial segment had long been a weakness for his company and that the partnership could help fill the gap. Ford chief executive Jim Hackett said the move could help expand the U.S. automaker’s truck footprint in foreign markets in South America, Europe and Africa.

But the deal also is a response to a much bigger threat posed by companies outside the traditional automotive sector, said Hackett. In the face of growing competition from Tesla, Uber and Waymo, the automakers' alliance could determine the fate of some of the most recognizable brands in the world, according to Jessica Caldwell, an industry analyst at Edmunds.

“Automakers aren’t just competing with each other anymore,” she said. “They’re under intense pressure from well-funded tech companies who are eager to get in on the future of mobility.”

Over the longer term, both companies acknowledged the potential benefits of working together on new automotive technologies. But despite some analysts' expectations, the companies said Tuesday they had not yet reached a formal agreement on electric or self-driving cars.

“I would just confirm it’s an attractive area,” Hackett told reporters Tuesday. “Both the AV and EV are big bills, or costs, for investment, for innovation. And both are really important to both companies' future, so that is part of the incentive to find ways to cooperate.”

Talk of a partnership began publicly last summer, when the two companies confirmed they were discussing working together on pickups and commercial cars.

Tuesday’s announcement reflects the culmination of those negotiations as both firms seek to transform their businesses. Ford is embarking on an $11 billion restructuring plan that’s expected to lead to thousands of layoffs and the closure of some plants. Ford has also said it intends to stop selling the vast majority of its sedans in the United States, as drivers flock to SUVs and crossovers. Meanwhile, execs have said they are “all in” on electric vehicle technology and plan to release their first EV since the Ford Focus Electric in 2020.

Volkswagen is further ahead on electric cars and aims to electrify its entire lineup by 2030. As part of that push, the company is developing a standardized, modular platform that will make it easier to build electric vehicles of varying types.

As VW ramps up production of electric cars in Europe and Asia, it will also add capacity in Chattanooga, Tenn., the company said Monday — hiring another 1,000 workers at its existing plant there. The Chattanooga facility is expected to begin producing electric cars by 2022.

Developing fully electric cars from scratch — as opposed to converting an existing model — involves steep costs. Tesla has managed the challenge by selling luxury EVs as a way to subsidize the cost of refining a mass-market electric car. Last week, General Motors signaled it was taking the same approach when it announced it would make Cadillac, the company’s premium brand, the focus of its electric development efforts.

“The luxury segment is a natural coupling,” said Jeremy Acevedo, an industry analyst at Edmunds. “Tax rebates and subvented leases have masked this to a degree, but it looks like the next big steps in the EV segment are going to come from the luxury set.”

Monday’s manufacturing announcement by Volkswagen quickly won plaudits from President Trump, who on Tuesday called it “a big win” and “a job well done” by city and state leaders.

Trump has been quick to dole out praise — and fire off criticism — in response to automakers' plans, amid the perception that their business decisions could reflect on his overall handling of the economy. Trump gushed over General Motors and Ford when they announced investments that could create U.S. jobs. But as those companies have sought to retool their global operations to meet a changing market, Trump has slammed the auto on social media.