Five years ago, when Mr. Modi made formal his longtime ambition of leading India, he chose as his stage and constituency Varanasi, a city of temples and gods. On Thursday, Mr. Modi was re-elected to that seat, with a victory margin of nearly half a million votes. His party’s resounding nationwide victory means the powerful and divisive prime minister will lead India for another five years.

Mr. Modi is a self-made man, rising from modest beginnings through his party’s Hindu nationalist wing to become the longest-serving chief minister of Gujarat, one of India’s largest states. There, he was known for a blend of business-friendly policies that sped development and the promotion of Hindu nationalist ideology.

Varanasi, an ancient city on the banks of the sacred Ganges River, offered the perfect backdrop to take that mix to the national level. Millions of visitors arrive every year — for pilgrimages, tourism or Moksha, a Hindu belief that the souls of those who are cremated on a funeral pyre by the sacred river will be free from the cycle of reincarnation. To bathe in the river is to wash away one’s sins.

Mr. Modi framed his decision to run from Varanasi as a religious calling, intertwining his name with the holy place. If he made progress in modernizing the city, the word of mouth from visitors would become a 24/7 image campaign.