DAMIAN J. TROISE and ALEX VEIGA - AP Business Writers

NEW YORK (AP) -- Stocks shook off a midday slump and ended higher Thursday, keeping the market on track for its first weekly gain after three weeks of punishing losses.

Trading was wobbly throughout the day as investors remained focused on another day of testimony before Congress by Federal Reserve Chair Jerome Powell.

The S&P 500 rose 1%, the Dow Jones Industrial Average added 0.6% and the Nasdaq rose 1.6%.

Powell reaffirmed the central bank's goal of "keeping inflation expectations well and truly anchored" as the Fed tries to rein in surging prices.

The yield on the 10-year Treasury note, which helps set mortgage rates, fell to 3.09%.