(Reuters) - The euro wallowed near a four-month trough versus the dollar Thursday after some banks in Athens faced emergency funding needs, compounding fears that a potential Greek exit from the euro could put more pressure on other struggling euro zone nations.

The common currency fetched $1.2730, up 0.1 percent on the day, but still within shouting distance of its four-month low at 1.2681 plumbed the day before. It has already shed 4.1 percent in May, coming close to its 2012 trough of 1.2624.

Contagion fears and jitters over political turmoil in Athens, where politicians rejecting harsh austerity measures are likely to win June 17 elections, have sent riskier assets such as the Australian dollar sharply lower over the last three weeks.

On top of that, the European Central Bank stopped providing liquidity to some Greek banks as they are severely undercapitalized, moving them to an emergency liquidity assistance program.

The euro may get a bit of a respite after sustaining severe losses this month, but even if it's bought back a little bit, does this change the big picture? I don't think so, said Teppei Ino, currency analyst at the Bank of Tokyo-Mitsubishi UFJ.

The euro is still a 'sell', although investors may want to wait for the outcome of Greek elections before pressuring it further.

A Greek departure from the euro area would have a potentially damaging knock-on effect on other ailing economies such as Italy and Spain, whose bond yields have climbed back towards the crucial 6 percent mark this week.

Underscoring these concerns, World Bank President Robert Zoellick said Greece's exit could undermine confidence in the euro area and trigger another liquidity crisis.

Germany wants to stabilize Greece within the euro zone but Athens must stick to its agreements with international lenders, a German government spokesman said on Wednesday.

Investors continued to shift into assets viewed as safe, pushing the dollar index - a gauge of its performance against major currencies - to a four-month high of 81.573 .DXY.

That helped the greenback perform well against the yen, with it last at 80.31, not far from a two-week high of 80.56 hit on Wednesday. Its advance stalled ahead of resistance at the Ichimoku cloud's kijun line, on Thursday at 80.60.

Wide-spread risk aversion and worries about slowing Chinese growth weighed on higher-yielding currencies such as the Aussie dollar, which stood at $0.9929, a bit above a five-month low of $0.9870 hit the day before.