BERLIN—A group of German auto makers agreed to pay slightly more than €2.5 billion ($2.71 billion) for Nokia's digital mapping service, prevailing over Silicon Valley bidders in a battle for a key enabling technology for self-driving cars.

German luxury car makers Audi, a unit of Volkswagen AG, Mercedes-Benz parent Daimler AG, and BMW AG have agreed in principle to purchase the telecommunications group's digital mapping service Nokia Here, according to a person familiar with the situation.

If a deal is struck, which isn't yet certain, the German auto makers plan to invite other automotive companies such as Fiat Chrysler Automobiles NV, Renault SA, PSA Peugot Citroë n, Ford Motor Co., Toyota Motor Corp. and General Motors Co. to invest in Nokia Here, two people familiar with the situation said.

"The goal has always been to run the service as an open platform for everyone," one person said. "The final signing could take place in the next few days."

Nokia Here generated more than half its €970 million in 2014 sales from the auto industry, the rest from location-based services. The deal price may be less than Nokia hoped to achieve. Nokia built the business out of Navteq, an online mapping service that it bought in 2008 for $8.1 billion.

Nokia declined to comment. Audi, Daimler and BMW also declined to comment.

The German car makers entered the bidding after Nokia announced in April that it was considering a sale in the wake of its acquisition of Alcatel-Lucent and its plan to focus on its telecommunications equipment business.

The car makers feared that Nokia Here's technology—the most advanced digital map of the world's major road networks—could fall into the hands of Google Inc., Uber Technologies Inc. or Apple Inc. That would put auto makers at risk of losing control of information systems inside the car that are vital to self-driving cars and future automotive safety systems.

Separately, German auto-parts supplier Robert Bosch GmbH and the Dutch digital mapping company TomTom NV agreed to work together to develop high-definition digital maps needed for self-driving cars, the companies said on Tuesday.

"We will only be able to have self-driving vehicles on the highway in 2020 with highly accurate maps," said Dirk Hoheisel, Bosch general manager, in a statement.

Bosch said it will provide technology to make TomTom digital maps more accurate and better able to incorporate data produced by the automobile's systems.

"We want to have highly accurate maps for self-driving vehicles of all highways and similar roads in Germany by the end of 2015," said Jan-Maarten de Vries, a TomTom automotive division vice president.

Car makers think that the car could become a platform for generating income—from location-based services that find nearby restaurants, parking garages or to book hotels and other services that turn the data generated by the car into profits.

Uber, the car-hailing service, initially joined with China's tech giant Baidu Inc. But the Uber-led consortium fell apart and Uber dropped out of the bidding last month. Uber bought digital navigation technology and hired employees from Microsoft Corp. in a bid to lessen its dependence on Google and Apple, whose mapping technologies help power Uber's ride-sharing app.

That left a group of private equity investors and the German car companies as the remaining bidders.

By early July, Nokia was holding exclusive talks with the German car makers. Talks have been bogged down in details, from how much Nokia Here is actually worth to patents on intellectual property. But people familiar with the situation say the two sides are close to finalizing a deal.

The battle over Nokia Here has put a huge spotlight on an obscure part of the technology industry that will play a big role in the future development of cars, trucks and other forms of transportation.

Today, many people use Google Maps or another navigation service to get to their destination.

But once cars become even partially self-driving, the car's computer will need infallible information about the road ahead and traffic around the car in real-time. That is why the digital mapping business has taken on such importance.

"We are not just building a map," said Floris van de Klashorst, in charge of Nokia Here's connected driving business, during a recent interview. "We are creating a 3D high-definition digital representation of the world in real-time."

Digital mapping services have shifted from an old model of providing a static map that is stored on the car's navigation system to a dynamic system that provides drivers with information about traffic and road conditions in real-time.

Nokia Here and its rivals are developing collaborative systems that would allow each car to upload data to a cloud-based computer network as it cruises down the road. This information is then available in real-time for users of their systems.

"That's why we need more car companies involved," said Mr. van de Klashorst. "The more cars providing information the better the map."

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

Access Investor Kit for Bayerische Motoren Werke AG

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=DE0005190003

Access Investor Kit for AUDI AG

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=DE0006757008

Access Investor Kit for Daimler AG

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=DE0007100000

Access Investor Kit for Volkswagen AG

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=DE0007664005

Access Investor Kit for Volkswagen AG

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=DE0007664039

Access Investor Kit for Nokia Oyj

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=FI0009000681

Access Investor Kit for Alcatel-Lucent SA

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=FR0000130007

Access Investor Kit for Renault SA

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=FR0000131906

Access Investor Kit for Toyota Motor Corp.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=JP3633400001

Access Investor Kit for TomTom NV

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=NL0000387058

Access Investor Kit for Alcatel-Lucent SA

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US0139043055

Access Investor Kit for Apple, Inc.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US0378331005

Access Investor Kit for Baidu, Inc.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US0567521085

Access Investor Kit for Daimler AG

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US2338251083

Access Investor Kit for Ford Motor Co.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US3453708600

Access Investor Kit for General Motors Co.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US37045V1008

Access Investor Kit for Google, Inc.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US38259P5089

Access Investor Kit for Google, Inc.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US38259P7069

Access Investor Kit for Nokia Oyj

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US6549022043

Access Investor Kit for Toyota Motor Corp.

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US8923313071

Access Investor Kit for Volkswagen AG

Visit http://www.companyspotlight.com/partner?cp_code=P479&isin=US9286623031

Subscribe to WSJ: http://online.wsj.com?mod=djnwires