The euro zone economy narrowly avoided a technical recession in the last three months of 2023 despite shrinking output in Germany, mainly thanks to strong growth in Spain and Portugal and a modest increase in Italy, data showed on Tuesday.

A preliminary estimate from the European Union's statistics office Eurostat said gross domestic product in the 20 countries sharing the euro currency, was flat in the fourth quarter against the previous three months.

The result beat market consensus of a 0.1% quarter-on-quarter decline in GDP which would have put the euro zone in a technical recession, defined as two consecutive quarters of shrinking GDP.

Also year-on-year the fourth quarter was better then expected by economists polled by Reuters, rising 0.1% against the same period 12 months earlier, rather than staying unchanged as forecast by analysts.

The euro zone's fourth largest economy Spain was the biggest contributor to the overall outcome with quarterly growth of 0.6% while smaller Portugal grew 0.8%. Growth in third biggest Italy also accelerated to 0.2% in the last three months from 0.1% in the previous quarter.

This helped offset a 0.3% quarterly plunge in the euro zone's biggest economy Germany and zero growth in the second biggest France. (Reporting by Jan Strupczewski)