May 7 (Reuters) - Indian shares were flat on Thursday as lower oil prices on hopes of a potential U.S.-Iran peace deal offset profit-taking in select sectors after a sharp rally in the previous session.

The Nifty 50 fell 0.02% to 24,326.65, while the BSE Sensex edged 0.15% lower to 77,844.52.

Both benchmarks had jumped 1.2% on Wednesday and moved in a narrow range on Thursday, swinging between gains of 0.5% and losses of 0.3%.

Other Asian markets also advanced after reports suggested Iran and U.S. were nearing a deal to end the conflict. [MKTS/GLOB]

Brent crude, which tumbled 7.8% in the previous session, fell 2.4% to about $99 a barrel on Thursday. India is the world's third-largest oil importer. [O/R]

"Recent developments from the Middle East suggest that both U.S. and Iran are looking for a solution to resolve the war, which is a big positive for domestic equities," said Siddhartha Khemka, head of research of wealth management at Motilal Oswal Financial Services.

"However, the gains in domestic markets have been tempered as a deal is still not a reality, while currency pressures continue to deter foreign inflows," Khemka said.

Eleven of the 16 major indexes gained.

Auto index jumped 1.9%, led by a 2.8% rise in Bajaj Auto after upbeat quarterly results.

Mahindra & Mahindra added 2.1%, extending its three-session post-results gain to 8.5%.

Hero MotoCorp gained 3.4%, with brokerages citing improving demand, stronger electric-vehicle positioning and exports as near-term earnings support.

PSU banks and IT declined 0.5% and 0.8%, respectively, after strong gains on Wednesday.

Broader small-caps and mid-caps rose 0.9% and 1.1%.

One97 Communications climbed 7.8% after the Paytm operator swung to a March-quarter profit.

Godrej Consumer fell 5.3% despite higher quarterly profit, after multiple brokerages flagged near-term margin risks from input-cost inflation.

(Reporting by Bharath Rajeswaran in Bengaluru; Editing by Sumana Nandy and Sherry Jacob-Phillips)

By Bharath Rajeswaran