"Condolences to the families of those who lost their lives in the Nairobi attack and prayers with the injured," Modi said in a tweet.
"Spoke to India's High Commissioner to Kenya and spoke to people of the Indian community there over the unfortunate attack in Nairobi," he further tweeted.
Modi, who was recently named BJP's prime ministerial candidate, also lauded the efforts of a hospital built by the Indian community in Nairobi which was providing assistance during the crisis.
Two Indians were among the 59 people killed so far in the attack by Somali Islamist militants at an upscale shopping mall in Nairobi.
Fighting between terrorists and Kenyan security forces was on for the second day following the attack.