Oil rose above $94 per barrel for the first time since May on Tuesday, buoyed by hopes for economic stimulus and worries about supply disruptions.
Traders waited to see if a tropical storm could affect some of Mexico's crude production. There were also concerns about supplies from the Middle East after two pipelines carrying Iraqi crude to world markets were shut down, while rebels continued to battle government forces in Syria's largest city.
Oil prices also benefited from expectations that Europe, the U.S. and China will take fresh steps to promote economic growth, thereby boosting demand for oil. A rally in global stock markets also persuaded investors to buy riskier assets like commodities.
Meanwhile, analysts expect drivers on the West Coast of the U.S. to soon pay more for gas after a fire shut Chevron Corp.'s big Richmond refinery.
Chevron closed the refinery near San Francisco after a fire broke out Monday. There is no immediate word on when it will reopen. The refinery accounts for about 10 percent of all refining capacity on the West Coast and primarily produces gasoline.
Motorists should expect to soon see pump prices average more than $4 per gallon along the West Coast, said Tom Kloza, chief oil analyst at Oil Price Information Service. The average price for a gallon of regular in California was $3.86 on Tuesday.
Nationally, the average gasoline price rose 1.5 cents to $3.634 per gallon, according to AAA, Wright Express and OPIS. That's about a quarter more than it was a month ago and just 4 cents less than a year ago.
In New York, benchmark U.S. crude increased $1.47 to finish at $93.67 per barrel. It rose as high as $94.42 earlier. Brent crude, which is used to price international varieties of oil, rose $2.45, or 2.2 percent, to end at $112 per barrel, in London.
Authorities said Tropical Storm Ernesto could intensify into a hurricane and has the potential of moving into the Bay of Campeche, which houses two of Mexico's oil production areas. Mexico was the seventh-largest oil producer in the world in 2010 and the third-largest exporter to the U.S. last year, according to the Energy Information Administration.
Other tropical storms also are beginning to form that could affect oil tankers delivering supplies to the U.S.
"People have to realize it doesn't necessarily have to take a major storm to slow down imports into the Gulf Coast," Price Futures Group oil analyst Phil Flynn said.
In other trading on the New York Mercantile Exchange:
— Wholesale gasoline rose 6.91 cents to finish at $2.9913 per gallon.
— Heating oil rose 5.71 cents to end at $2.9980 per gallon.
— Natural gas rose 5.6 cents to finish at $2.9640 per 1,000 cubic feet.