MADRID (Reuters) - The Spanish government has acquired the 10% stake in telecoms group Telefonica it had set out to buy in December to counterbalance the acquisition of a similar stake by Saudi Arabia's STC, the state holding company SEPI said on Monday.

SEPI bought just over 567 million shares in the Spanish company at an average price of 4.0295 euros ($4.38) a share, spending around 2.3 billion euros.

"This ends the carrying out of the purchase operation ordered by the cabinet," SEPI said in a filing to the stock market regulator.

STC built a 9.9% stake in Telefonica worth 2.1 billion euros in September. Its holding consists of 4.9% of Telefonica's shares and financial instruments that give it another 5%.

The government has said that SEPI's entry was aimed at improving Telefonica's shareholder stability and safeguarding its strategic capabilities because Telefonica is considered a defence service provider and the leading player in the telecommunications sector.

On May 8, after having reached a 7% stake in the company, the government requested a seat on Telefonica's board and proposed Carlos Ocana, a former industry ministry cabinet chief, to represent the government's interests.

($1 = 0.9202 euros)

(Reporting by Andrei Khalip; Editing by Leslie Adler)