Wall Street ended the week with a bang, rocketing to session highs on the back of another crude oil surge. 

Stocks closed out their fourth straight week of gains. The S&P 500 rose 1.6% on Friday, trading above 2,000 again. The Dow Jones Industrial Average added 1.3%, and the Nasdaq was up 1.9%, pulling out of correction territory.

Crude soared on a one-two punch of good news. The number of active U.S. oil rigs fell to its lowest level on record, with data from Baker Hughes showing a decline of nine rigs, leaving the total at 480, the 12th straight weekly decline.

Crude was already higher after a report from the International Energy Agency indicated spiraling prices may be coming to an end. The energy watchdog said markets would likely not see a recovery until 2017, but that recent signs signal that stabilization is possible.

The IEA pointed to "possible action by oil producers to control output; supply outages in Iraq, Nigeria and the UAE; signs that non-OPEC supply is falling; no reduction in IEA's forecast of oil demand growth; and recent weakness of the U.S. dollar" as possible forces that could stabilize prices.

Oil prices have slowly recovered in recent weeks after hitting a panicked low in February of about $26 a barrel. West Texas Intermediate crude oil closed 1.7% higher at $38.50 a barrel, its best settlement since December.

The energy sector was the best performer on markets Friday. Major oilers PetroChina (PTR) , Royal Dutch Shell (RDS.A) , Total (TOT) and BP (BP) were higher, while the Energy Select Sector SPDR ETF (XLE) added 2.6%.

If you liked this article you might like

Energy Takes a Backseat as Crude Oil Stabilizes Under $50

Alibaba and Tencent Could One Day Be Bigger Than Apple

Stocks Remain Lower Even After Fed's 'Beige Book' Finds Steady U.S. Growth

Stocks Hold Lower as Crude Oil Plummets Below $48

S&P 500 and Nasdaq Say Goodbye to Record Highs as Energy Disappoints