TOKYO - The dollar was on the back foot on Thursday after U.S. economic data continued to point to slowing growth, although that gave little relief to the yen, which was pinned around a 38-year low that kept the market on alert for government intervention.

The euro held not far off a three-week high against the greenback, and sterling firmed ahead of UK elections later in the day.

The dollar index, which measures the greenback against a basket of peer currencies, was flat at 105.28 after briefly weakening to its lowest since June 13 at 105.04 on Wednesday.

Softer-than-expected U.S. economic data on Wednesday, including a weak services report and ADP employment report, depicted a slowing economy, following an increase in initial applications for U.S. unemployment benefits last week.

"Slowly but surely, what we're starting to see is a bit of a turn in the U.S. economic data flow," said Rodrigo Catril, senior currency strategist at National Australia Bank (NAB).

"We think that the U.S. economy is slowing, with the labour market now starting to show signs of slackness, as well as activity and inflationary pressures easing."

Attention now turns to the closely watched nonfarm payrolls report due on Friday, which is expected to show an increase of 190,000 jobs in June after rising 272,000 in May, according to a Reuters poll of economists.

Ahead of the jobs report, the string of weaker economic data had the market pricing in about a 68% chance of a U.S. rate cut in September versus 56% a week ago, according to the CME FedWatch tool.

U.S. Treasury yields also fell on Wednesday.

But despite the drop in both the dollar and yield levels, the yen JPY=EBS was still stuck not far from a low of 161.96 per dollar hit in the previous session, its lowest since December 1986.

Traders were preparing for possible Japanese government currency intervention with U.S. markets off for the July Fourth holiday, given Tokyo stepped in on April 29 and May 1 during illiquid points in the global trading day or holiday thinned trading.

Japan spent 9.79 trillion yen ($61.31 billion) defending the currency in those two rounds of heavy yen buying.

But the cards were not in favour of the yen.

"The reality is that there's a structural issue going on here that favours the weaker yen," NAB's Catril said.

The Bank of Japan being set to normalise interest rates only at a gradual pace continues to encourage traders to push the dollar higher against the yen, he added.

The Japanese currency last strengthened 0.11% versus the greenback to 161.53.

The yen was also close to the all-time low of 174.48 against the euro EURJPY=EBS hit on Wednesday.

Elsewhere, sterling GBP=D3 was holding its ground ahead of elections in the UK after gaining on the dollar overnight, trading at $1.2744, up 0.03% on the day.

Britain looks set to elect Labour Party leader Keir Starmer as its next prime minister when voters go to the polls on Thursday, sweeping Rishi Sunak's Conservatives out of office after 14 often turbulent years.

The euro EUR=EBS was up 0.04% at $1.079, after rising to a three-week high against the dollar on Wednesday.

In cryptocurrencies, bitcoin BTC= last rose 1.41% to $60,376.65.

World FX rates https://tmsnrt.rs/2RBWI5E

(Reporting by Brigid Riley; Editing by Jamie Freed)