German automaker Volkswagen Group will invest up to $5 billion in U.S. electric-vehicle maker Rivian as part of a new, equally controlled joint venture to share EV architecture and software, the companies said on Tuesday.

Shares of Rivian surged by about 50% in extended trade after the announcement, potentially supercharging the company's market value by nearly $6 billion, if gains hold on Wednesday.

The auto industry faces a crucial time as EV startups grapple with a slowdown in demand amid high interest rates and dwindling cash, while traditional automakers struggle to build battery-powered vehicles and advanced software.