Strongly denouncing the attack, the prime minister saluted the soldiers who were martyred and said their service to the nation will always be remembered.
"We strongly condemn the cowardly terror attack in Uri. I assure the nation that those behind this despicable attack will not go unpunished," Modi tweeted on the incident in which 17 soldiers were killed and 19 injured.
"We salute all those martyred in Uri. Their service to the nation will always be remembered. My thoughts are with the bereaved families," he said.
Modi said he has spoken to Home Minister Rajnath Singh and Defence Minister Manohar Parrikar on the situation in the wake of the terror attack.
While the home minister held a high-level review meeting in New Delhi, Parrikar went to Kashmir along with Army Chief Gen Dalbir Singh Suhag to take stock of the situation.
Heavily armed militants stormed a battalion headquarters of the Army in North Kashmir's Uri town in the wee hours on Sunday, killing 17 jawans and injuring 19 other personnel in the strike in which four ultras were neutralised.
President Pranab Mukherjee also condemned the "outrageous" terrorist attack saying that India would thwart the "evil designs" of terrorists and their backers.
"India will not be cowed down by such attacks, we will thwart the evil designs of terrorists and their backers," the President said, without naming Pakistan.
Mukherjee, who is also the Supreme Commander of the Indian Armed Forces, strongly condemned the "outrageous terrorist attack on Army base in Uri".
Paying rich tributes to brave soldiers who made supreme sacrifice, the President expressed heartfelt condolences to the families of those who laid down their lives in the terror strike.
He also prayed for speedy recovery of those injured.
Uri, a small town located 103 kms north of Srinagar, woke up to heavy gunfire when four terrorists of Jaish-e-Mohammed group entered the battalion headquarters of 10 Dogra regiment and killed 17 soldiers. All the four terrorists were eliminated.
PHOTOS: Uri army camp attack worst since 2002
17 soldiers killed in Uri brigade camp attack; 4 terrorists eliminated
The implications of the Uri attack
Pakistan is a terrorist state, it should be isolated: Rajnath
'Proxy war has to be fought by proxy terrorism'