After trading on a tepid note throughout the session, the BSE Sensex surged in the last hour of trade to finish at 37,393.48, up by 278.60 points, or 0.75 per cent.
Similarly, the broader NSE Nifty rose 100.10 points, or 0.90 per cent, to settle at 11,257.10.
IT, financial and banking stocks saw robust buying.
Bajaj Finance was the biggest gainer in the Sensex pack, spurting 3.64 per cent, after the company reported a jump of 50 per cent in standalone net profit at Rs 1,114 crore for the March quarter.
Tata Motors, Infosys, Vedanta, ONGC, PowerGrid, NPTC, Axis Bank, ICICI Bank, Kotak Bank, SBI, HDFC Bank, Tata Steel, TCS and RIL rose up to 3.48 per cent.
On the other hand, Yes Bank was the top loser, cracking 4.07 per cent, followed by Bharti Airtel, IndusInd Bank, Coal India, ITC, M&M, HDFC, Maruti and Asian Paints, shedding up to 1.87 per cent.
Global markets recoiled after US President Donald Trump slapped sanctions on Chinese telecom major Huawei, ratcheting up its trade tensions with Beijing.
Sectorally, the BSE oil and gas, realty, power, metal, IT, teck, bankex and finance indices ended up to 1.53 per cent higher.
The BSE mid-cap and small-cap indices followed the benchmarks, gaining up to 0.27 per cent.
Foreign institutional investors (FIIs) net sold shares worth Rs 1,142.44 crore on Wednesday, while domestic institutional investors (DIIs) purchased equities to the tune of Rs 671.77 crore, provisional data available with stock exchanges showed.
Bourses in China, Japan and Korea ended on a mixed note, while European stocks opened in the red.
Meanwhile, the Indian rupee appreciated by 27 paise to 70.07 against the US dollar intra-day.
Global oil benchmark Brent crude was trading 0.56 per cent higher at USD 72.17 per barrel.