MADRID, Feb 22 (Reuters) - Spanish telecoms company Telefonica said on Thursday a write-off in Britain and the cost of a layoff plan in Spain prompted it to book a net loss of 2.15 billion euros ($2.32 billion) during the fourth quarter.

The net loss compared with a 742 million euro loss expected by analysts, according to a company-provided consensus.

During the quarter, the company booked a 1.15 billion euro exceptional cost to pay for a layoff plan in Spain and a 1.73 billion write-off on Virgin Media O2, its British unit.

Excluding the one-off costs, Telefonica booked a net profit of 730 million euros, it said.

The company said its core earnings during the quarter were 1.8 billion euros, out of revenues of 10.15 billion euros, and 11.39 billion euros in the full year 2023 out of 40.65 billion euros, which met its targets.

The telecoms firm reiterated its core profit and revenue growth targets for 2024 and maintained its annual dividend at 0.30 euros per share.

($1 = 0.9253 euros) (Reporting by Inti Landauro; Editing by David Latona)