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.

Get the latest news and more great videos at NewsdayTV Credit: Newsday

Updated 58 minutes ago Newsday probes police use of force ... Let's Go: Holidays in Manorville ... What's up on LI ... Get the latest news and more great videos at NewsdayTV

Get the latest news and more great videos at NewsdayTV Credit: Newsday

Updated 58 minutes ago Newsday probes police use of force ... Let's Go: Holidays in Manorville ... What's up on LI ... Get the latest news and more great videos at NewsdayTV

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME