Benchmark Indices ended marginally higher on Wednesday in a volatile trading session, despite weakness in the European markets and in some Asian markets.

At the close, Sensex ended 54.13 points, or 0.09 per cent, higher at 59,085.43, and Nifty ended 27.45 points, or 0.16 per cent, at 17,604.95. A total of 2,118 shares have advanced, 1,290 shares have declined, and 138 shares remained unchanged.

IndusInd Bank, NTPC, ICICI Bank, Power Grid Corp of India, and Kotak Mahidra Bank remained major gainers on the BSE. BSE Cap Goods and BSE Private Bank index surged the most.

BSE LargeCap Index rose 0.16 per cent, whereas BSE SmallCap and MidCap index rose 0.83 per cent and 0.80 per cent, respectively.

"Caution prevailed in the market ahead of monthly expiry on Thursday, while key benchmark indices eked out modest gains and shrugged off weak sentiment across most of Asian and European markets," said Shrikant Chouhan, Head of Equity Research, Retail, Kotak Securities Ltd.

Gains were muted as investors preferred to stay on the sidelines ahead of the Federal Reserve Chairman Jerome Powell's speech at the Jackson Hole symposium this Friday.

Asian markets were also ended lower on Wednesday as most investors awaits Powell's speech at the end of the week.

The benchmark Shanghai Composite index dropped 1.9 per cent, while Hang Seng Index ended 1.2 per cent lower.

European shares extended a selloff on Wednesday.