* S&P 500 gains after two days of losses
* European shares gain after four days of losses
* Oil prices rally 3 percent, boosting shares
* Strong European earnings reports boost region's shares
* Dollar gains ahead of Friday's U.S. jobs data (Updates to open of U.S. markets; changes byline, dateline, pvs LONDON)
By Sam Forgione
NEW YORK, May 5 (Reuters) - U.S. and European stock markets recovered on Thursday after a rebound in oil prices boosted energy shares, with some strong European earnings reports also supporting stocks in the region, while the dollar rose ahead of Friday's U.S. employment data.
Oil prices jumped 2 percent as a huge wildfire near Canada's oil sands region and escalating tensions in Libya stoked concerns among investors of a near-term shortage in supply. rally in crude prices helped lift the S&P energy index .SPNY 1.4 percent, making it the lead gainer among the 10 major S&P sectors. Investors awaited monthly jobs data on Friday, which is expected to show nonfarm payrolls likely rose by 202,000 in April and the unemployment rate held at 5 percent.
Firmer oil prices also lifted shares of major European oil producers, while encouraging European earnings updates from firms including telecoms group BT BT.L and oil company Repsol REP.MC helped prop up the stock market.
Thursday's gains in the S&P 500 stock index came after two straight days of losses, while the gains in European shares came after four days of losses.
"What we're seeing is a bit of a relief rally from oversold levels," said Adam Sarhan, chief executive of Sarhan Capital in New York.
MSCI's all-country world equity index .MIWD00000PUS was last down 0.24 points, or 0.06 percent, at 395.99.
The Dow Jones industrial average .DJI was last up 49.38 points, or 0.28 percent, at 17,700.64. The S&P 500 .SPX was last up 4.74 points, or 0.23 percent, at 2,055.86. The Nasdaq Composite .IXIC was last up 8.53 points, or 0.18 percent, at 4,734.17.
Europe's broad FTSEurofirst 300 index .FTEU3 was last up 0.31 percent at 1,306.8. crude LCOc1 was last up 89 cents, or 1.99 percent, at $45.51 a barrel. U.S. crude CLc1 was last up $1.05, or 2.4 percent, at $44.83 per barrel.
The U.S. dollar rose against a basket of currencies for a third day as traders closed out profitable bets against the greenback before Friday's U.S. jobs report. dollar index .DXY , which measures the greenback's value versus six currencies, rose to its highest level in a week of 93.862 after falling to its lowest in over 15 months on Tuesday of 91.919.
The dollar also rose against the yen JPY= to a six-day high of 107.49 yen after hitting an 18-month low on Tuesday of 105.52 yen.
"We are seeing some short covering lifting the dollar against most major currencies," said Ron Simpson, director of currency research at Action Economics in Tampa, Florida. "You can largely attribute it to tomorrow's nonfarm payrolls report."
U.S. Treasury yields were little changed as the number of Americans filing for unemployment benefits rose unexpectedly but remained within the range of a strong labor market, leaving investors with no clear signals ahead of the U.S. jobs report. 10-year U.S. Treasury yields US10YT=RR were last at 1.78 percent.
Spot gold prices XAU= fell $2.51 or 0.20 percent, to $1,276.60 an ounce.