Telefonica plans to buy German cellphone operator E-Plus from Netherlands-based Royal KPN NV in a deal that values the target company at 8.1 billion euros ($10.7 billion), the Spanish telecom giant said Tuesday in a regulatory filing.

Royal KPN is to receive 5 billion euros in cash - 4.14 billion euros from Telefonica and the rest from minority shareholders in German subsidiary Telefonica Deutschland - and a 17.6 percent stake in the expanded Telefonica Deutschland.

The transaction, which Telefonica expects to complete by mid-2014, is subject to approval by regulators and still needs approval from the boards of Royal KPN and Telefonica Deutschland.

Telefonica-owned O2 is Germany's fourth-largest cellphone operator, while E-Plus ranks third.

The companies have a combined subscriber base of 42.7 million, meaning that the proposed deal would create Germany's top cellphone operator in terms of customers.

Together, E-Plus and O2 had revenues of 8.6 billion euros in 2012, according to Telefonica.

The Spanish firm said it expects the merger of O2 and E-Plus to generate up to 5.5 billion euros in cost savings.

"(T)his transaction will mainly be financed via financial instruments, which will enable to maintain Telefonica's leverage ratio stable," the company said. EFE