The benchmark S&P BSE Sensex rose over 400 points on Wednesday, posting gains for the second consecutive day amid a rally in the global markets.

The Sensex gained 401 points, or 1.59%, to close at 25,719 points, while the NSE Nifty was up 130 points, or 1.70%, ending the session at 7,818 points.

The rally was mainly by a recovery in global markets after witnessing high volatility for many days due to rising concerns over the global economy.

The US equity markets closed with a gain of over 2% on Tuesday amid receeding chances of an interest rate hike by the US central bank this month. A rate hike by the US Federal Reserve is a major negative for emerging markets such as India.

But some contrarians believe that a rate hike by the US Fed can be a positive factor for India, as it shows that growth in the world's largest economy is robust.

"Counterintuitively, I think if the Fed hiked in September, which is now a receding probability and the markets are pricing in less, if they do hike, it will actually be good for India," says Ridham Desai, Managing Director, Morgan Stanley, in an interview with ET Now.

The rally was also supported by the Prime Minister Narendra Modi's meeting with industry heads on Tuesday. Union Finance minister Arun Jaitley, who was also present at the meeting, boosted sentiments by saying that the key reform bill, the Goods and Service Tax (GST), will be "introduced sooner rather than later."

"The long-awaited implementation of the GST in India could bring significant benefits to the economy. But a decade after it was first proposed, there are still a number of sticking points preventing its introduction. In truth, not only does the Finance Ministry's hope of introducing the GST by April 2016 look unrealistic, implementation by April 2017 would be a stretch too," said Capital Economics in a note.

Asian markets also ended higher on Wednesday, lending support to the domestic equity markets. The Chinese stock market rose more than 2% for the second straight session on hopes that the country's authorities will roll out support measures to boost the country's sagging economy.

Earlier on Monday, a data showed that China's imports fell sharply by over 14% in August, intensifying concerns over growth in the world's second largest economy.

Besides, Chinese officials announced tax exemptions to stem the high volatility in the country's stock market. The government has waived off a 5% dividend tax on stocks held for more than one year.

Meanwhile, the Japanese stock market index Nikkei surged by 7.7%, recording its biggest one-day gains since October 2008.

"With many markets having been sold off heavily over recent weeks, today's rally, like the U.S. last night, represents a speculative bounce," Angus Gluskie, managing director of White Funds Management in Sydney, told Reuters.

Gold prices traded weak on the day, falling by Rs 25 to Rs 26,675 per 10 grams amid reduced demand from jewellers and retailers. Silver prices rebounded by Rs 130 to Rs 35,330 per kg, supported by an increase in buying from companies and coin manufacturers.

The rupee appreciated by 0.2% to 66.41 against the US dollar, tracking the strengthening Asian currencies versus the greenback. The dollar remains weak as a result of fading expectations over the US Fed rate hike at its meeting next week.