KSE benchmark 100-share index ended 1.11 percent, or 128.37 points, higher at 11,711.40.
Volume rose to 110.39 million shares, compared with 78.9 million shares traded on Monday.
"The market rallied based on renewed foreign interest, which gave confidence to local investors to step in as well," said Asad Iqbal, chief investment officer at Faysal Asset Management Ltd.
Lucky Cement ended 1.67 percent higher at 65.94 rupees and Maple Leaf Cement closed 2.56 percent up at 2.40 rupees.
In the currency market, the rupee firmed against the dollar amid fewer import payments, and dealers said the local unit is expected to be range-bound in the coming days because of higher remittances.
The rupee closed at 85.25/35 to the dollar, compared with Monday's close of 85.31/36.
In the money market, overnight rates remained at a high of 13.90 percent amid tight liquidity in the interbank market. Dealers said rates would likely stay high because of the end of the quarter.