The Sensex climbed 102 points to close at 25,516 and the Nifty advanced 23 points to end at 7,635.
In the broader markets, the smallcap index gained 1%. In intra-day, the S&P BSE Small-cap index touched its highest level since February 2008.
Meanwhile, the midcap was up 0.6%, outperforming the Sensex which was up 0.4%.
On the macro front, Indian factory activity expanded in June at its quickest pace since February while output prices rose at the fastest rate in eight months, signaling a further rise in inflation that is bound to vex the RBI, a business survey showed on Tuesday.
The HSBC Manufacturing PMI, compiled by Markit, advanced to 51.5 in June from 51.4 in May. But domestic demand remained weak, hurting jobs growth.
The rupee is trading at 60.10, higher than its previous close of 60.17/18 on foreign inflows and absence of any Reserve Bank intervention so far, dealers say.
Sectors & Stocks
Auto and Metal indices were among the top sectoral gainers up 2-3%. Capital Goods and Realty indices edged up 1% each.
Please click here for the Complete Coverage of Budget 2014 -15
Maruti Suzuki ended up 6% at Rs 2,584, after reporting a 33.5% year on year increase in its total sales for June at 1,12,773 units. The country's largest car-maker had sold 84,455 units in the same month last year.
Tata Motors rose 4.6%, M&M gained 4% while in the two-wheeler space Bajaj Auto rose 1% and Hero MotoCorp ended up 0.6%.
Metal shares firmed on the back of encouraging data from China. China's factory growth rose to a six-month high in June on improving domestic and foreign demand, indicating that the economy is witnessing an uptick.
Hindalco gained nearly 7% and was the top gainer among sensex-30. Some of the other gainers from the metal space were Tata Steel was up 2.5%, and Sesa Sterlite firmed up 1.4%.
Meanwhile, capital goods shares continued their uptrend after a private survey showed that India's manufacturing sector growth in June. L&T and BHEL ended up 1% each.
IT majors witnessed profit taking after IT research firm Gartner trimmed its worldwide IT spend growth forecast to 2.1% from 3.2% earlier. TCS, Infosys and Wipro ended down 0.8-1.2%.
Sun Pharma, HDFC, Gail India, Reliance Industries and NTPC which ended down 0.6-1% were some of the other names in red.
The market breadth was positive ion BSE. 1,904 stocks advanced while 1,142 stocks declined.
Global Markets
Asian shares held near three-year highs on Tuesday on upbeat Chinese manufacturing data and expectations that U.S. monetary policy will stay loose for some time, while the dollar was broadly soft.
Japan's Nikkei rose 1.3% while the MSCI's broadest index of ex-Japan Asia-Pacific shares was flat, staying just under a three-year high hit three weeks ago. Hong Kong markets were closed for a holiday.
China's official Purchasing Managers' Index showed factory growth rose to a six-month high in June, as expected, and a similar private survey also showed strong activity, reinforcing signs of stabilisation in the economy.
All the major markets in Europe were in green. CAA, DAX and FTSE gained 0.2-0.5%.
Please click here for the Complete Coverage of Budget 2014 -15
How to make money from stocks
Sexual assault case: Tarun Tejpal gets bail
Buying travel insurance? 6 things you must know
Trade imbalance not sustainable: India tells China