BANGKOK (AP) — Shares were higher in Asia on Friday, tracking gains on Wall Street, where the market is headed for its first weekly gain after three weeks of punishing losses.

Tokyo’s Nikkei 225 index added 0.9% to 26,411.64 and the Kospi in Seoul jumped 1.8% to 2,356.38. Hong Kong’s Hang Seng advanced 1.4% to 21,567.30 and the Shanghai Composite index added 0.4% to 3,334.67.

In Australia, the S&P/ASX 200 gained 0.2% to 6,539.10. Shares also rose in India and Taiwan.

Market players are looking ahead to U.S. inflation data due next week. They appeared to shrug off preliminary data showing a moderation in activity in several countries including Japan.

A report Friday showed inflation in Japan remained at 2.1% in May, pushed higher by energy costs and a weaker currency. However, underlying core inflation, which excludes volatile costs for energy and fresh foods, remained at 0.8% and the central bank is unlikely to follow the example of the U.S. Federal Reserve and other central banks in raising interest rates, analysts said.

The Bank of Japan “isn’t convinced that this will be sustainable because wage growth remains soft and higher energy costs are weighing on corporate profits and consumer sentiment,” Marcel Thieliant of Capital Economics said in a commentary.

On Wall Street, trading was wobbly as investors focused on another round of testimony before Congress by Federal Reserve Chair Jerome Powell. He told a House committee the Fed hopes to rein in the worst inflation in four decades without knocking the economy into a recession, but acknowledged “that path has gotten more and more challenging.”

The S&P 500 ended 1% higher at 3,795.73 after having been down as much as 0.4%. The Dow Jones Industrial Average rose 0.6% to 30,677.36 and the Nasdaq gained 1.6% to 11,232.19.

Smaller company stocks also gained ground. The Russell 2000 rose 1.3% to 1,711.67.

Trading has been turbulent in recent weeks as investors try to determine whether a recession is looming. The benchmark S&P 500 is currently in a bear market. That means it has dropped more than 20% from its most recent high, which was in January. The index has fallen for 10 of the last 11 weeks.

On Thursday, Powell stressed: “I don’t think that a recession is inevitable.” He has said it’s ”certainly a possibility” and that the central bank is facing a more challenging task amid the war in Ukraine essentially pushing oil and other commodity prices even higher and making inflation even more pervasive.

Powell spoke to Congress a week after the Fed raised its benchmark interest rate by three quarters of a percentage point, its biggest hike in nearly three decades. Fed policymakers also forecast a more accelerated pace of rate hikes this year and next than they had predicted three months ago, with its key rate to reach 3.8% by the end of 2023. That would be its highest level in 15 years.

The Labor Department reported Thursday that fewer Americans applied for jobless benefits last week, though it was slightly more than economists expected. The solid job market is a relatively bright point in an otherwise weakening economy, with consumer sentiment and retail sales showing increasing damage from inflation.

As higher prices stretch pocketbooks, consumers are shifting spending from big ticket items like electronics to necessities. The pressure has been worsened by record-high gasoline prices that show no sign of abating.

Big technology and health care companies did much of the heavy lifting. Microsoft rose 2.3% and Johnson & Johnson rose 2.2%.

Energy stocks fell as the price of U.S. crude oil dropped 1.8%. Valero fell 7.6%.

Early Friday, U.S. benchmark crude oil was up 1 cent at $104.28 per barrel in electronic trading on the New York Mercantile Exchange. Brent crude, the basis for pricing for international trading, shed 34 cents to $106.12 per barrel.

Bond yields fell significantly. The yield on the 10-year Treasury note, which helps set mortgage rates, fell to 3.09% from 3.15% late Wednesday.

The U.S. dollar fell to 134.73 Japanese yen from 134.94 yen. The euro rose to $1.0535 from $1.0524.

___

AP Business Writers Damian J. Troise and Alex Veiga contributed.