Last December, the government decided to enter the company as a counterbalance to the acquisition of a stake in Telefonica by Saudi Arabia's STC. On Monday, state holding company SEPI said it had bought an initial 3% stake.

"It will be done as quickly as possible, in the shortest possible time, provided that it doesn't affect (Telefonica's) share price," Alegria told a news briefing after the weekly cabinet meeting.

Telefonica shares were up around 1% in afternoon trading at 4.03 euros a share, outperforming the broader market in Madrid, up 0.37%. They have gained 13% so far this year.

Alegria added this would give greater shareholder stability to the company and safeguard its strategic capabilities, since Madrid considers Telefonica a defence services provider.

In September, STC announced it had built a 9.9% stake in Telefonica worth 2.1 billion euros ($2.28 billion) in a move to become its top shareholder. Its holding consists of 4.9% of Telefonica's shares and financial instruments that give it another 5% in so-called economic exposure to the company.

Following the government's decision to buy a 10% stake, a source with knowledge of the matter told Reuters the buying would be piecemeal in small quantities over a period of up to two months and should be financed with public debt issuance.

($1 = 0.9213 euros)

(Reporting by David Latona; Editing by Andrei Khalip)