Allen & Overy (A&O), CMS Hasche Sigle and McDermott Will & Emery have scored the leading roles on Telefonica's €5bn (£4.3bn) purchase of Dutch telecoms company KPN's German mobile unit.

Telefonica's German subsidiary Telefonica Deutschland Holding has acquired E-Plus, the German business of KPN, in a deal which will also see KPN receive a 17.6% stake in Telefonica Deutschland.

Telefonica is the parent company of O2, which it took over in 2005 in a £17.7bn deal. The latest deal will see E-Plus combined with O2 in Germany, a tie-up Telefonica claims will create the second largest European operator by number of mobile customers and volume of revenue.

A&O is acting for KPN with a team led by Amsterdam corporate partner Jan Louis Burggraaf, flanked by Frankfurt corporate partner Hartmut Krause, Amsterdam competition partner Kees Schillemans and Frankfurt tax partner Asmus Mihm. The firm is representing the company alongside financial advisers JP Morgan and Goldman Sachs.

CMS Hasche Sigle is fielding a team advising Telefonica Deutschland, comprising Munich M&A partner Oliver Thurn, Frankfurt partner Hildegard Ziemons and Munich partners Martin Kolbinger and Martin Kuhn.

US firm McDermott is advising Telefonica with a team based in Frankfurt including corporate partners Joseph Marx, Andreas Kurtze and Clemens Just, acting alongside capital markets partner Philipp von Ilberg.

In the past year Telefonica has sought legal advice from the likes of Clifford Chance (CC), legacy Herbert Smith and Spanish firm Ramon & Cajal.

Ramon took a role on Telefonica's €1bn (£859m) sale of call centre business Atento to Bain Capital last October, while CC acted for the company on China United Network Communications Group's $1.4bn (£902m) buyback of shares last June.

In the same month Herbert Smith acted on the creation of Everything Everywhere, the UK joint venture between Telefonica and Vodafone.