The replacement of the next-generation mobile network equipment is part of Telefonica's strategy announced in 2019 to diversify suppliers, according to the source.

Expansion said the telecoms company has initially rolled out some Huawei equipment that it had already bought before seeking to secure alternative supplies.

The source at Telefonica declined to say how much equipment Telefonica bought from Ericsson or when the purchase was made.

Huawei and Ericsson's Spanish unit did not immediately respond to requests for comment.

Telefonica's 2019 decision came at a time when China's Huawei, the global market leader in network equipment, had been drawn into the centre of political tensions between Washington and Beijing.

The United States has alleged the company's equipment could be used by the Chinese government for espionage. Huawei and Beijing have repeatedly denied the allegations.

When Telefonica's announced its strategy two years ago, it said its decision to diversify was purely technical in nature and that it had seen no evidence to support the American allegations that Huawei gear posed a security risk.

(Reporting by Inti Landauro; Editing by Pravin Char)