The Sensex and the Nifty rose nearly 0.4 per cent, led by gains in export-focussed companies after the rupee fell to a near two-year low in early trade, while bullish brokerage calls also helped drugmakers such as Sun Pharmaceutical Industries.
The dollar has surged by almost 20 per cent against a basket of major currencies in the past year as expectations have grown that the US Fed would become the first major central bank to hike rates since the financial crisis.
Gains in export-focussed companies and value-buying in some other blue-chips offset losses in financial stocks.
Upbeat economic data from the United States and a weak rupee are helping IT stocks, said Alex Mathews, head of research at Geojit BNP Paribas.
The 30-share BSE index Sensex ended higher by 100.10 points or 0.36 per cent at 27,931.64 and the 50-share NSE index Nifty was up 28.6 points or 0.34 per cent at 8,495.15.
Among BSE sectoral indices, healthcare index gained the most by 2.63 per cent, followed by consumer durables 1.39 per cent, IT 0.72 per cent and capital goods 0.51 per cent. On the other hand, metal index was down 1.33 per cent, followed by PSU 1.09 per cent, realty 1.01 per cent and banking 0.46 per cent.
Shares of export-focussed companies led the gains. Sun Pharmaceutical Industries rose 4.32 percent after Bank of America Merrill Lynch upgraded the stock to "buy" from "neutral", citing the company's integration with Ranbaxy Laboratories, price hikes at unit Taro and improvement in US supplies as key reasons.
Glenmark Pharmaceuticals shares jumped 3.48 per cent after the company received final approval from the US FDA for a copy of Bayer's Yaz contraceptive drug.
Among IT stocks, Infosys rose 0.97 per cent, HCL Tech gained 1.88 per cent and Wipro increased 2.15 per cent.
Shares of Delhi-based developers rose after reports that the country's environment ministry spelt out the dimensions of the eco-sensitive zone around Noida's Okhla bird sanctuary by limiting it to 1 km. The move is expected to unfreeze projects that have been in limbo for two years.
Jaiprakash Associates surged 9.39 per cent, Jaypee Infratech gained 5.3 per cent, and Unitech rose 0.7 per cent.
Meanwhile, Bharti Airtel fell 0.6 per cent after a report that Reliance Industries would roll out its Jio 4G-enabled handsets next month.
Meanwhile, foreign portfolio investors (FPIs) sold shares worth a net Rs 255.42 crore yesterday.
A report by Goldman Sachs said: "Recent activity data is coming in a tad better, with our current activity indicator showing an uptick in Q2. July data on PMI, auto sales, and indirect tax collections have also shown an improvement.Corporate results for Q1, FY16 show some tentative positive signs, though sales and earnings growth remain weak. While July headline CPI inflation came down significantly in yoy terms, we would advise caution as the month-on-month decline was not as large. We continue to expect the RBI to remain on hold through FY16 due to recent FX weakness, long monetary transmission lags and uncertainty about the impact of monsoons, as well as the potential impact of an impending Fed rate hike. After the recent CNY depreciation, we have revised our 3, 6, and 12m USD-INR targets to 64.5, 65, and 65. We think that INR will likely outperform the region due to a strong balance of payments driven by lower oil prices and higher FDI inflows. In the policy front, while legislation on GST has stalled, there has been some progress on bank reforms and some big-ticket announcements have been made on FDI."
Global markets
European stock markets fell on Wednesday, extending a recent losing streak on the back of persistent worries over China, while brewer Carlsberg slumped after cutting its outlook.
The pan-European FTSEurofirst 300 index, which had its worst five-day run in more than a month last week, fell 0.8 per cent. The euro zone's blue-chip Euro STOXX 50 index also declined by 0.9 per cent.
Asian shares on Wednesday struggled at two-year lows after Chinese stocks extended their fall, stoking fears about the stability of China's economy.
A 6 per cent tumble in Chinese shares on Tuesday and soft earnings from Wal-Mart held US equities in check, while copper touched multi-year lows.