The officials say the men , believed to be terrorists , were detained hours after unidentified attackers threw a grenade at the Indian consulate in the city 's center Tuesday night .