New York

Stocks rose Friday to wrap up their strongest week in almost three months. Banks gained ground after Federal Reserve Chair Janet Yellen said the central bank intends to keep raising interest rates provided the economy continues to improve.

Stocks turned higher over the last few hours of trading to finish at their highest levels of the day. Banks made the largest gains, as they stand to make bigger profits on lending if interest rates rise. Phone companies traded higher after Verizon reportedly agreed in principle to a new contract with striking employees. Alphabet led technology stocks higher.

Yellen said it will be "appropriate" to raise interest rates in the next few months if the economy continues to improve, and emphasized that the Fed will move slowly and carefully. There were signs of that improvement throughout the week, including increased home sales, leading to big gains for stocks. On Friday the Commerce Department said the U.S. economy grew a bit more in the first quarter than it previously estimated. In recent months stocks have slumped when investors thought the Fed might be about to raise interest rates. That may have changed this week.

"Both inflation and growth are on an upward trend," said Jon Adams, senior investment strategist for BMO Global Asset Management. He said investors may be worrying a bit less about the Fed's plans because the economy could be getting onto more solid footing, but the central bank must remain careful in dealing with investor expectations.

The Dow Jones industrial average rose 44.93 points, or 0.3 percent, to 17,783.22. The Standard & Poor's 500 index added 8.96 points, or 0.4 percent, to 2,099.06. The Nasdaq composite index picked up 31.74 points, or 0.6 percent, to 4,933.50.

The Commerce Department said the U.S. economy was a bit stronger in the first quarter than it initially believed. The agency said the gross domestic product grew 0.8 percent in the first three months of the year, above its original estimate of 0.5 percent. That's still sluggish, but experts think the economy will grow about 2 percent in the current quarter.

Bank stocks were led higher by Bank of America, which rose 18 cents, or 1.2 percent, to $14.88, and Citigroup, which picked up 47 cents, or 1 percent, to $46.58. Bond prices dipped and yields rose. The yield on the 10-year U.S. Treasury note rose to 1.85 percent from 1.83 percent.

Google's parent company Alphabet rose after a federal jury said the company did not need permission to use tools made by Oracle when it built its Android software. Oracle said Google stole its intellectual property and sought $9 billion in damages, and it plans to appeal the ruling. Alphabet stock added $10.67, or 1.4 percent, to $747.60.