The NSE S&P CNX Nifty gained 24.75 points to 1,568.65. The market closed firm after India and Pakistan announced a ceasefire of military operations across the border, which will have a significant impact on the polity and economics of the two countries, according to market players.