NEW YORK (Reuters) - The dollar dipped against a basket of currencies on Friday, fading from a two-week peak which was tied to news of a record Chinese trade surplus that may fuel U.S.-China trade tensions and that briefly spurred safe-haven bids for the greenback.

A money changer counts U.S. dollar banknotes at a currency exchange office in Diyarbakir, Turkey May 23, 2018. REUTERS/Sertac Kayar

The dollar’s pullback likely stemmed from modest gains on Wall Street and a drop-off in trading volume before the weekend, analysts said.

“The U.S. dollar has been moving inversely with stocks. They could have restrained the dollar somewhat,” said Eric Viloria, currency strategist at Wells Fargo Securities in New York.

An index that tracks the dollar against the yen, euro and four other currencies was down 0.07 percent to 94.740 after touching 95.241, which was the highest since June 29.

The S&P 500 index hit a five-month high on strength from the industrial and energy sectors.

The yen recovered from a six-month trough against the greenback after hitting a six-month low at 112.79 yen before recovering to 112.30 yen, up 0.2 percent on the day.

The euro fell to a nine-day low at $1.1610 before ending flat at $1.1680.

The yuan fell half a percent in offshore markets to as low as 6.7250, near an 11-month trough of 6.7326 on July 3.

Despite the greenback’s stalling on Friday, prospects for a strong dollar remain intact.

“It’s hard to see what’s going to dethrone the dollar,” said Paresh Upadhyaya, director of currency strategy at Amundi Pioneer Investments in Boston.

“Trade war concerns amplify the downside risk on global growth. That tends to be positive for the dollar and puts a drag on other currencies,” Upadhyaya said.

Upbeat comments on the U.S. economy from Federal Reserve Chairman Jerome Powell also stoked earlier demand for the dollar, analysts said.

U.S. Treasury Secretary Steven Mnuchin said on Thursday that the United States and China might reopen trade talks, briefly easing concerns about the trade dispute.

But data showing China’s trade surplus with the United States swelled to a record in June could further inflame tensions. U.S. President Donald Trump this week pledged to impose tariffs on $200 billion more in Chinese imports. Beijing has vowed to retaliate.

Escalating trade tensions have not dented the U.S. economy, which on is its second longest expansion on record.

On Thursday, Fed chief Powell said in a Marketplace radio interview he believes the U.S. economy remains in a “good place,” with recent government tax and spending programs likely to boost growth for perhaps three years.

The Fed released its semiannual report on monetary policy before Powell’s testimony to Congress next Tuesday and Wednesday. The report showed solid U.S. economic growth and the Fed expecting to keep raising rates gradually.

Graphic - World FX rates in 2018: tmsnrt.rs/2egbfVh

Graphic - U.S. trade with China: tmsnrt.rs/2KAT34a

Graphic - China trade with U.S.: reut.rs/2HjTuSw