The Sensex ended 95 points higher at 34,427 while Nifty rose to 10,565, up 39 points.
"Markets had a breather on Wednesday mainly due to profit booking, but the optimism of positive quarterly results are driving the momentum," said Anand James, chief market strategist at Geojit Financial Services.
Investors cheered March-quarter results of IT firm Mindtree Ltd, sending the shares 3 per cent higher.
Information technology stocks bounced back from recent losses with the NSE IT index up more than 1 per cent and TCS gaining nearly 1 per cent.
HPCL slumped 6 per cent while Bharat Petroleum Corp Ltd fell nearly 7 per cent.
"Investors are shrugging off the rising oil prices as our inflation over the past few months has eased and even the monsoon forecast is for a normal one," James added.
Get the latest election news, live updates and election schedule for Lok Sabha Elections 2019 on ndtv.com/elections. Like us on Facebook or follow us on Twitter and Instagram for updates from each of the 543 parliamentary seats for the 2019 Indian general elections.