A Wall Street street sign outside the New York Stock...

A Wall Street street sign outside the New York Stock Exchange on July 16, 2013. Credit: AP / Mark Lennihan

Stocks closed higher on Wall Street, capping a four-week rally.

Energy companies were among the biggest gainers Friday as energy prices continued to recover. Devon Energy surged 11 percent and Anadarko Petroleum added 9 percent.

Bank stocks also rose sharply. That sector had been beaten down in recent weeks as investors worried about loans to highly leveraged energy companies going bad.

The gains nearly brought the market back to breakeven for the year.

The Dow Jones industrial average rose 218 points, or 1.3 percent, to 17,213.

The Standard & Poor’s 500 index gained 32 points, or 1.6 percent, to 2,022. The Nasdaq composite climbed 86 points, or 1.9 percent, to 4,748.

Bond prices fell. The yield on the 10-year Treasury note rose to 1.98 percent.

Takeaways from the governor debate ... September home prices fall ... Plays of the week Credit: Newsday

Updated 44 minutes ago 'Forever chemicals' in LI waters ... Takeaways from the governor debate ... AG Letitia James at Newsday ... Trendy Bites: Apple Bay pizza

Takeaways from the governor debate ... September home prices fall ... Plays of the week Credit: Newsday

Updated 44 minutes ago 'Forever chemicals' in LI waters ... Takeaways from the governor debate ... AG Letitia James at Newsday ... Trendy Bites: Apple Bay pizza

Subscribe

Unlimited Digital AccessOnly 25¢for 6 months

SUBSCRIBESALE ENDS SOON | CANCEL ANYTIME