Germany's biggest mobile operator at present is Deutsche Telekom AG's T-Mobile, which serves some 36.6 million people; Vodafone is second with 33.9 million customers. The combination of E-Plus and O2 would have nearly 43 million; Telefonica put their combined revenues last year at 8.6 billion euros.
"This transaction is a strong commitment to the German market and a significant step in Telefonica's growth story providing us with a leading position within the strongest economy in Europe," Eva Castillo, the chairwoman of Telefonica Deutschland's supervisory board and the chief executive of Telefonica Europe.
The German economy is Europe's biggest and has continued to grow even as countries across large parts of Europe struggle with public debt and recessions.
Telefonica has mobile and fixed-line operations across Europe and Latin America. The company said the German deal would make it Europe's second-biggest operator in terms of cellphone customers.
Telefonica, which has been working to reduce its debt, noted that "this transaction will mainly be financed via financial instruments, which will enable to maintain Telefonica's leverage ratio stable."
The announcement came as KPN said its second-quarter net profit fell to 108 million euros, down 68 percent from the same period a year ago due to tough market conditions for its mobile phone operations and an ongoing decline in fixed-line services.
KPN said its revenues in the second quarter dropped 8 percent to 2.9 billion euros from 3.2 billion euros a year earlier. CEO Eelco Blok said the company will now "focus on its core geographies," and the company said it will use most of the cash from the sale to "increase its financial flexibility."
KPN shares were up 5.3 percent compared with Monday's close at 1.90 euros. The deal also sent Telefonica's shares 2.4 percent higher to 10.31 euros in early trading in Madrid.
In Germany, rival Deutsche Telekom which will face one fewer competitor if the deal goes through was one of the biggest winners on Frankfurt's DAX index of blue chip stocks. Its shares climbed 1.8 percent to 9.35 euros.