The benchmark indices ended the first session of the week with marginal gains after European finance ministers authorized a loan payout to Greece and US manufacturing accelerated in June.
The Sensex ended at 18,814, higher by 52 points and the Nifty ended at 5650, up 23 points.
The midcap index ended at 6974, higher by 70 points and the smallcap index shut shop at 8318, up 93 points.
The markets had started the day with a bang in the wake of firm global cues, with the BSE benchmark gaining nearly 200 points and the Nifty testing the crucial 5,700 mark at opening bell.
The Asian bourses were going strong; Hang Seng, Nikkei and Shanghai were up more than 1% each.
The ministers had agreed over the weekend to provide a loan of 8.7 billion euros ($12.7 billion) to Greece under last year's 110 billion-euro bailout by July 15 after the Greek parliament passed a legislation enabling tax increases, spending cuts and privatisations as part of the required austerity package.
And in the US, the Institute for Supply Management's factory index climbed to 55.3 last month from 53.5 in May, the first gain in four months.
While the markets did surrender a part of their gains in the early part of trade itself, they still managed to close on a confident footing in the wake of continued stability on the global front.
Shanghai stocks hit a six-week high after data last week showed Chinese manufacturing growth moderated in June.
Markets in Hong Kong and Japan also closed higher in the region of 1-2% each.
And the European indices, including the FTSE, CAC and DAX were flat in mid-day trades.
It may be recollected that the Nifty had rallied from lows of 5,250 and sailed past 5,600 in six trading sessions till last Thursday.
Going forward, the monsoons and first quarter earnings will determine the future course of the markets.
HDFC unveils its first quarter results on July 8 and Infosys will declare its numbers on July 12.
Reliance Infra soared by 6.8% at Rs 578