If KPN's disposal of E-Plus passes muster, the new company would hold a share of about 30 percent of Germany's mobile service revenue and would be better armed to take on Deutsche Telekom and Vodafone, with 35 percent each.
Telefonica said it expects the deal to close in the first half of 2014, implying it expects an in-depth antitrust review by the European Commission.
KPN, which is 30 percent owned by Mexican tycoon Carlos Slim's America Movil, will receive 5 billion euros cash and a 17.6 percent stake in the newly merged company valued at some 3.1 billion euros. Cost savings from the deal would be between 5.0 billion euros and 5.5 billion.
The price represents a multiple of 9.0 times E-Plus's forecast core earnings, making it attractive to KPN given the sector average is currently at 4.7 times according to ThomsonReuters data.
It was not clear if Slim backs the deal to sell KPN's crown jewel to Telefonica, his arch rival in Latin America. America Movil has two seats on the KPN supervisory board and KPN did not say if the vote was unanimous.
For Telefonica, which has been selling assets for the past two years to cut its debts, the deal is a bold bet on Germany, a market where despite recent intensified competition profit margins remain high compared with Britain and Spain.
It also shows that the Spanish group's deleveraging efforts have paid off, putting it in a position to pull off an important deal in a key market, said people involved in the talks.
The two-stage deal is structured to minimise increases in Telefonica's debt by paying as much as possible in equity. First, Telefonica will issue 4.14 billion euros in debt - roughly 50 to 65 percent from hybrid debt, 20 to 30 percent from a mandatory convertible bond and the rest from incremental debt.
Then, once regulatory approval is secured, a 3.7 billion euros rights issue would be carried out by Telefonica Deutschland, to which Telefonica will subscribe for 2.84 billion to maintain its stake at 76.8 per cent.
Telefonica said it expected the deal would not affect its key net debt to core earnings (EBITDA) ratio. Rating agencies have not yet given their view on the deal.
The two companies had flagged the deal late on Monday and sources earlier confirmed to Reuters the structure and price of the combination.
"As we have said for many years, we will sell any asset for the right price," KPN Chief Executive Eelco Blok said. "For a long time people have predicted this combination would happen and we're very, very pleased that we have reached an agreement."
The deal is the latest in a spate of acquisitions in the global telecom sector, which is reshaping an industry struggling in Europe but flourishing in the United States and Asia where prices and profits are higher.
Telecoms M&A is up 20 percent year-on-year, with 354 deals worth $52.8 billion dollars announced as of July 18, according to data from Thomson Reuters.
Vivendi for instance also on Tuesday agreed to sell a controlling stake in Maroc Telecom to Gulf operator Etisalat, while Japan's Softbank, Vodafone and cable group Liberty Global have all recently done deals.
Because of its size and cross-border implications, the European Commission's antitrust watchdog will closely evaluate the deal's impact on consumers and network quality in Germany.
In recent deals, such as in Austria where operators sought to reduce the number of players to three from four, regulators have demanded concessions such as spectrum divestments and pledges to offer competitive rental terms to rivals.
"In an environment where in-market consolidation has been put under intense regulatory scrutiny ... we believe such a deal would face significant hurdles in principle, even before discussing potential concessions," wrote analyst Ulrich Rathe at brokerage Jefferies.
A person involved in the deal said Telefonica and KPN did not sounded out regulators on the deal, which came together in the past month. Some spectrum divestments were likely, the person added, but the German market would remain competitive with three operators since multiple brands vie for customers.
For KPN, the deal is an acknowledgement that it could no longer fight it out in Germany's increasingly competitive market. The cash-strapped operator missed out on buying the best kind of fourth-generation mobile spectrum, leaving it as a disadvantage to rivals offering faster mobile data plans.
Instead it went on the attack in January, cutting prices and touching off a market share land-grab that sapped its own profits as well as that of other telcos in the once-cosy market.
The Dutch group's openness to a deal also increased when the German regulator decided the next spectrum auction would not include the kind of spectrum KPN needed for at least another two years, said people familiar with the talks.
Telefonica made an initial approach after KPN completed its capital increase in May and an agreement was reached in a matter of weeks, said people involved in the talks.
One person involved in the talks said KPN saw it as a good time to sell given E-Plus's weak market position.
"Slim and KPN know they will never get as good a price for this asset as they will get right now," the person said. "The competitive environment in Germany is getting worse ... E-Plus is in an unsustainable position in Germany - too small, too few spectrum holdings and (an) inability to invest."
On a conference call, KPN boss Blok refused to explain America Movil's position, only adding that the Mexican group had two members on the supervisory board which approved the deal.
KPN said it would use the majority of the cash proceeds to improve its balance sheet and would restart paying a dividend for 2014. That means Slim, who is nursing huge paper losses on his roughly 4 billion euro investment in KPN, cannot even count on getting a share of the sale proceeds this year.
KPN, which has some 24 million customers in Germany, saw its core profit decline by 30 percent in the country, adjusted for one-off items, in the second quarter as it lowered its prices to attract new customers.
At group level, core profit, adjusted for one-offs, fell 11 percent in the quarter to 1.08 billion euros, above the 991 million expected in a Reuters poll of 10 analysts.
KPN said JP Morgan, Goldman Sachs, ABN AMRO and law firm Allen & Overy were its advisors.
Telefonica was advised by Citigroup, HSBC and Morgan Stanley, which will also be carrying out the financing of the deal, according to people familiar with the matter.
UBS was joint advisor to Telefonica Deutschland alongside Bank of America Merrill Lynch.
($1 = 0.7580 euros)
(Additional reporting by Victoria Bryan in Frankfurt, with Sophie Sassard and Anjuli Davies in London; Writing by Leila Abboud; Editing by Ben Deighton and David Holmes)
By Robert-Jan Bartunek and Clare Kane