BERLIN— Volkswagen AG is selling the Bugatti hypercar business to create a new company jointly owned by the Croatian electric car startup Rimac Automobili and VW’s sports car unit Porsche AG , as the auto industry’s pivot to electric vehicles transforms the elite world of super high-performance sports cars.

The deal marks the end of an era for Bugatti, one of the most recognizable names in the world of super luxury vehicles, after two decades spent under ownership of the German auto giant, which is now shifting to electric vehicles.

Last year, Portuguese soccer star Cristiano Ronaldo bought one of only 10 Bugatti La Voiture Noire supercars ever made for around $10 million. At the time, the athlete posted a picture of himself on Instagram bare-chested leaning against the new car.

Bugatti nearly disappeared after World War II, when founder Ettore Bugatti died and the company entered a period of decline. The company ceased operations in 1952. It was bought in 1987 by Italian businessman Romano Artioli, who restored the company as a maker of limited edition sports cars. But Bugatti quickly fell on hard times again, ceased production and was bought by VW in 1998.

The late Ferdinand Piech, grandson of Beetle designer Ferdinand Porsche, pressed Bugatti to undertake the ambitious and controversial plan to build what became the Veyron. With a top speed of 254 mph, at the time of its launch in 2005 the Veyron was the fastest legal road car on the planet. The Veyron was succeeded by the Chiron, which sells for around $3 million.

The Chiron sells for about $3 million.

The Chiron sells for about $3 million.

Photo: Sjoerd van der Wal/Getty Images

But such big, powerful combustion engine vehicles are out of step with the shift toward electric vehicles that has gripped the global auto industry. And VW, which said recently it would phase out combustion engine vehicles in Europe by 2035, wants to focus development resources on EVs.

The deal marks a high point for Mate Rimac, a 33-year-old Croatian engineer who has achieved star status in the auto industry for innovative designs and technology of a new generation of super high-performance electric sports cars that has underpinned Porsche’s efforts to build high performance EVs.

Rimac will be the majority shareholder with a stake of 55% in the joint venture, while Porsche holds the rest and will also retain its 24% stake that it holds in Rimac directly. The venture is expected to be officially launched in the fourth quarter of this year and will be based in Zagreb.

Volkswagen is investing in electric vehicles more than other legacy car makers in the U.S. WSJ goes inside an engine factory that is being transformed into a battery plant as the German giant looks to change its image and become a rival to Tesla. Photo illustration: George Downs The Wall Street Journal Interactive Edition

Rimac will restructure into a holding company, the Rimac Group, and two business units—one home to the company’s established business supplying EV technology to other auto makers and the other hosting the hypercar business that will be created by merging Bugatti with Rimac’s hypercar activities.

Mr. Rimac, who will become CEO of Bugatti-Rimac venture, said Rimac could seek a listing at some point in the future but that he was in no hurry.

Dubbed Bugatti-Rimac, the hypercar business will continue to build the Chiron and the all-electric Rimac Nevera, and will jointly develop new models for the future, including all electric Bugatti models.

A Rimac Nevera car was exhibited last month in Berlin.

A Rimac Nevera car was exhibited last month in Berlin.

Photo: Imago/Zuma Press

After transforming ordinary passenger cars, EV technology is beginning to reshape the high end of the market. Tesla Inc.’s roadster is now touted as one of the most coveted super luxury cars to own by a new generation of consumers that wants the performance without the emissions.

The Rimac Nevera, launched in 2018, is often at the top of rankings of electric supercars by auto trade magazines. And the shift in the industry has established makers of supercars trying to catch up.

While not as advanced, Lamborghini, Ferrari NV, McLaren and Aston Martin are also hatching plans to build electric supercars in the coming years.

Lamborghini, which is owned by VW’s Audi luxury car brand, said in May that it would launch its first all-electric car by the end of the decade and that by 2024 each of its models from the Aventador sports car to its popular Urus SUV would also come in plug-in hybrid versions.

Aston Martin, fictional British spy James Bond’s favorite ride, is also making a big shift to electric cars and has said it expects to generate one in five sales from EVs by 2024.

Corrections & Amplifications
Volkswagen is the name of the German car company. An earlier version of this article’s headline incorrectly spelled it Volkswagon. A photo is of a Chiron. A previous version of a caption called it a Veyron. Also, Ettore Bugatti was succeeded by five children when he died in 1947. A previous version of this article incorrectly said that he was heirless.

Write to William Boston at william.boston@wsj.com