China's yuan eked out a small gain on Friday after authorities attempted to slow its recent slide, but still posted its biggest weekly loss in three months, pressured by a sputtering economic recovery, low yields and the U.S. dollar's broad rally.

The offshore yuan dropped in early morning trade to its weakest level since December, after the People's Bank of China set the midpoint rate at 7.0356 per U.S. dollar prior to the market open.

However, at the domestic session's close, it recovered to 7.0235 and gained about 0.1%, although for the week the yuan was still down 1.04%, the worst weekly-loss in three months.

The fixing, weaker than the previous fix 6.9967, was in line with Reuters' estimates and was the weakest fix since Dec. 5.

Investors took the weak fixing as a sign that the central bank would tolerate further weakness in the yuan. The yuan has fallen 1.04% against the U.S. dollar so far this week.

However, later in the morning currency traders said major state-owned banks were seen swapping yuan for dollars in the onshore forwards market, suggesting that authorities were trying to slow its rapid fall.

That came after the central bank set the fixing at 6.9967, the weakest fix since Dec. 5

State banks usually trade on behalf of the central bank in China's foreign exchange market, but they could also trade on their own behalf.

In onshore deals, the yuan opened at 7.05 per dollar and was changing hands at 7.042 at midday, 50 pips weaker the previous late session close and 0.1% away from the midpoint.

The spot rate is allowed to trade in a range 2% above or below the official fixing on any given day.

"China's latest April macro economic data point to a growth recovery that is running out of steam," Alvin Tan, head of Asia currency strategy at RBC Capital Markets, said in a report on Thursday.

Market participants "will be gunning for the 7.20-level in the near term before it settles down," he said.

The yuan's weakness came as the global dollar index was headed for a second straight weekly gain of more than 0.7% on Friday, as optimism over debt ceiling talks in Washington raised expectations that U.S. interest rates would remain higher-for-longer. It edged down to 103.521 from the previous close of 103.584.

In the yuan forwards market, the wide yield difference has the yuan trading stronger, thus disincentivising exporters to convert their earnings. Six-month yuan is trading at 6.9.

While spot yuan levels moved little after news of the state banks' moves, one-year dollar/yuan swaps eased to a low of -2,180 points, the lowest level since Nov 2022, and effectively pushing one-year yuan to 6.82 per dollar.

On Monday, investors will be eyeing the loan prime rate (LPR) setting, which are the key benchmarks for retail and corporate loans. In April both one-year LPR and five-year LPR were left unchanged at 3.65% and 4.3%, respectively, but the economic outlook has soured considerably since.

The offshore yuan was trading 0.20% weaker than the onshore spot at 7.0345 per dollar. (Reporting by Georgina Lee; Editing by Kim Coghill)