Telefónica shares soared on Wednesday after the Spanish group said it had agreed to sell its mobile phone antennas in Europe and Latin America to American Towers for 7.7 billion euros ($ 9.41 billion) in cash.

Telefónica’s Telxius division, partly owned by KKR investment fund and Zara owner Amancio Ortega’s investment vehicle, will deliver more than 30,000 mobile phone masts in Spain, Germany, Brazil, Peru, Chile and Argentina.

American Towers, based in the United States, will lease the telephone masts to Telefónica, leaving the Spanish group as the owner of the towers in Great Britain.

Telefónica, which along with its European peers has struggled to shore up the plunge in its share price in the face of fierce competition, will be able to use the proceeds from the sale to cut its net debt that accumulated during the heavy investment by € 4.6 billion networking.

It has said it aims to focus on more profitable businesses and exit less profitable markets like those in Latin America.

The shares were trading 8.7% higher on the day at 0845 GMT, outperforming a very slightly positive Madrid First Class Index.

Long-term inflation-linked income streams have made towers prized investment targets in a low-yield world. These networks are set to expand to accommodate the next-generation 5G internet and eventually connect billions of smart devices.

Telefónica CEO Josa Maria Alvarez-Pallete said the deal meant the company could focus on its “more ambitious goals,” such as an agreement to merge its British operations under the O2 brand with Virgin Media, the acquisition of the Brazilian operator Oi mobile assets and debt reduction.

As of September, net financial debt was 2.77 times basic adjusted earnings.

Revenues from the American Towers deal include a capital gain of about 3.5 billion euros, Telefónica said.

For the US firm, which dwarfs its main European rival Cellnex, the deal gives it access to a European market that is becoming increasingly attractive with the launch of 5G.

Cellnex has already built a tower network that spans most of Europe, while Vodafone plans to include its own Vantage towers infrastructure unit in Frankfurt.

Telefónica has said that it is analyzing all possible options for the future of the part of Telxius that it still owns, which is a submarine cable between Europe and the United States.