Stocks rose Wednesday as the price of oil surged.
The gains catapulted both oil and energy companies in the S&P 500 into positive territory for the month of September.
The Dow Jones Industrial Average gained 111 points, or 0.6%, to 18339. The S&P 500 gained 0.5%, and the Nasdaq Composite added 0.2%.
U.S.-traded crude oil jumped 5.3% to $47.05 a barrel after Iran's oil minister said the Organization of the Petroleum Exporting Countries reached an understanding that a large crude-oil-production cut is needed to lift petroleum prices.
Energy companies in the S&P 500 rose 4.3%, making the group the best-performing sector in the index. Exxon Mobil jumped 4.4% and Chevron gained 3.2%, together adding about 47 points to the Dow industrials.
Elsewhere, biotech stocks declined, weighing on the Nasdaq Composite. The Nasdaq Biotechnology index dropped 0.9%. The group has had a stellar performance in recent months. Since the end of June, the Nasdaq Biotechnology index is up roughly 15%, though it remains down 13% in 2016.
In other corporate news, Nike shares fell 3.8% after the sportswear maker signaled slowing future demand for its sneakers and apparel. Nike was the biggest decliner in the Dow industrials Wednesday.
The Stoxx Europe 600 rose 0.7% as the region's banking sector showed signs of a nascent recovery from a rough start to the week.
Shares of Deutsche Bank gained 2% in Europe after it said it sold its U.K.-based Abbey life insurance unit, boosting its capital cushion slightly.
Despite the day's gains, Deutsche Bank shares are still down this week on concerns about the German lender's financial health, having touched their lowest price in decades.
Investors are watching the health of the European banking sector closely. Recent declines in bank shares are particularly worrisome in Europe, where banks constitute a significant share of direct lending into the economy, said Jamie Cox, managing director at Harris Financial Group.
"It's a very ugly situation," he said. On top of the potential fines, "interest rates globally are low, and it doesn't appear there are prospects of them going up anytime soon -- when you're a financial institution and you live off the spread, it's difficult."
Investors largely expect the European Central Bank and Bank of Japan to ease policy further in the coming months. Meanwhile, the Bank of England will likely have to provide further stimulus to the U.K. economy to limit an economic slowdown caused by voters' decision to leave the European Union, Bank of England Deputy Gov. Minouche Shafik said Wednesday.
"It seems likely to me that further monetary stimulus will be required at some point in order to help ensure that a slowdown in economic activity doesn't turn into something more pernicious," she said.
In bond markets, the yield on the 10-year U.S. Treasury note rose to 1.567% from 1.556% on Tuesday after eight consecutive sessions of declines, its longest streak of declines since the middle of June.
Earlier, Japan's Nikkei Stock Average declined 1.3%, weighed by concerns around the price of oil and the impact of negative interest rates on the country's banks.