* STOXX posts 0.9 pct gain for May, up for 4th month in a row
* Ends day flat as trading marked by investors turning defensive
* Healthcare, staples up; banks, commodity stocks down
* Italian banks led lower by Carige
* Activist investor move boosts Ericcson (Updates to close)
MILAN, May 31 (Reuters) - European shares posted their fourth straight month of gains on Wednesday though fresh political worries and the lack of new catalysts following a surprisingly strong earnings season spurred investors to lock in some profits in banks and commodities-related stocks.
The pan-European STOXX 600 index ended the day little changed and up 0.9 percent in May, the slimmest rise since the streak of monthly gains began in February.
Robust corporate profits, relatively cheap valuations and diminishing political risks have lured investors back into regional stocks.
However, with valuations now back above historical averages, jitters over early autumn elections in Italy and the looming election in Britain has soured sentiment.
"Markets don't like political uncertainty and anticipating it is an inevitable excuse to take profits," said JCI Capital fund manager Alessandro Balsotti.
The past week has been marked by investors locking in some gains in sectors such as banks and mining and moving into safer stocks that tend to outperform during periods of uncertainty.
This was evident on Wednesday where strength in defensive, dividend-paying blue chips such as GlaxoSmithKline, Novartis and Sanofi helped limit losses on the index as consumer, banks and commodities-related stocks were sold.
Deutsche Bank shares ended the day down more than 3.4 percent as warnings from U.S. bellwethers JPMorgan and Bank of America on revenue weakness hit European peers.
The STOXX 600 has fallen 1.4 percent from its 21-month high hit earlier in May which much of the retreat seen in the latter half of the month.
In Britain, the FTSE ended the day little changed but posted its best month of the year, helped by a weaker pound.
Italian stocks, which suffered a heavy sell-off earlier this week on growing expectations the euro zone country may hold early elections, remained under pressures and fell XXX percent dragged lower primarily by banks.
The local banking index, hit by concerns over the rescue of two regional lenders, fell 0.7 percent, and touched its lowest levels in more than a month.
Among Italian lenders, Carige fell 6.5 percent as a row over the company's management fuelled worries that its recapitalisation plans could be delayed.
On the broader market, the Basic Resources index, where major mining companies are listed, was the biggest sectoral faller, slumped 2 percent, following iron ore prices' sharpest rout of the year on fears of a supply glut.
On the flipside, Ericsson rose 4.5 percent, after activist investor Cevian Capital bought a stake of more than 5 percent, saying it saw significant potential in the Swedish firm.
Cellnex soared 4 percent after a Bloomberg report said that American Tower may bid. Cellnex said its management has had no contact with American Towers. (Reporting by Danilo Masoni; Editing by Pritha Sarkar/Jeremy Gaunt)