The 30-share S&P BSE Sensex, which gained 354 points in the previous two sessions, traded between 20,135.91 and 20,323.77 before ending at 20,272.91, advancing 23.65 points, or 0.12 per cent.
The 50-share CNX Nifty on the NSE Nifty rose 13.5 points, or 0.22 per cent, to 6,020.95. The SX40 on the MCX Stock Exchange added 23.42 points to 12,079.15.
Brokers said investors turned cautious and parked their funds in less risky and fundamentally strong stocks ahead of the second-quarter earnings season, starting tomorrow with Infosys results.
They said a firm trend in the Asian region and a higher opening in Europe amid signs US lawmakers will agree on a compromise deal to avoid an unprecedented default, fuelled the uptrend.
Among the Sensex shares, 14 closed with gains. Infosys, the second most valued software company, rose 0.53 per cent to Rs 3,124.15, completing a four-day rising streak.
The auto sector index gained the most, rising 1.94 per cent, after some banks reduced lending rates for car and scooter loans. The metal sector added 0.49 per cent.
The IT sector index rose 0.44 per cent and the healthcare index 0.36 per cent.
Indian shares close near 3-week high ahead of Infosys results
(Reuters) - Indian shares rose on Thursday to their highest close in nearly three weeks, as Tata Motors surged to a record high on unit Jaguar Land Rover's sales while Infosys also edged up ahead of its July-September results.
While earnings would be the main focus, India's economic data namely industrial output on Friday and inflation prices on Monday are keenly awaited to find more bright spots in the economy after September trade data came in better than expected.
India likely saw little respite from high inflation levels in September as prices of food and imports continued to climb despite a relief rally in the battered rupee, a Reuters poll found.
Indian manufacturers increased production in August, although at a slower pace than in July, as infrastructure output rose, but access to cash was tougher, a Reuters poll found.
Local shares were also buoyed by signs of progress in U.S. budget talks which also helped European stocks edge off four-week lows.
"While the market is trading in a range, directional cues will come from how the results season pans out. Expect stock specific volatility to rise over the next few days," said Milan Bavishi, head of research at Inventure Growth and Securities.
The benchmark BSE index rose 0.12 percent, or 23.65 points, to end at 20,272.91 after marking its highest intraday level since Sept. 19.
The broader NSE index rose 0.22 percent, or 13.50 points, to end at 6,020.95.
Tata Motors' shares rose 4.9 percent after unit Jaguar Land Rover Ltd said in a statement that its September retail sales were up 17 percent, which dealers said were above expectations.
Infosys Ltd ended up 0.6 percent ahead of its July-September earnings results on Friday.
Among other IT stocks, Wipro Ltd ended 0.6 percent higher, while Tech Mahindra Ltd rose 2.5 percent.
Glenmark Pharmaceuticals Ltd rose 1.4 percent after unit Glenmark Generics said it has filed lawsuit against Triax Pharmaceuticals, Astellas International, Astellas Pharma Europe, seeking to enforce Glenmark's exclusive royalty agreement for a key drug.
Multi Commodity Exchange of India Ltd gained 5 percent after a stock and currency exchange partly owned by the company announced changes to its management and board.
MphasiS Ltd gained 2.5 percent, tracking gains in parent Hewlett-Packard Co, which rose after its chief executive on Wednesday guided for a stable outlook for 2014 and a recovery in 2015, dealers said.
However, among stocks that fell, Reliance Industries Ltd dropped 0.1 percent ahead of its September-quarter results on Monday.