Narendra Modi in Gandhinagar, India, on May 16, 2014. (Saurabh Das/AP)

NARENDRA MODI was widely expected to win a second term as India’s prime minister, but the scale of his victory was so surprisingly large when it was revealed on Thursday that some called it a miracle. For the first time in half a century, a ruling party won an absolute majority in the Parliament’s lower house for a second consecutive election. Mr. Modi’s Bharatiya Janata Party (BJP) is projected to end up with 303 of 545 seats, more than it won in the 2014 election. Apathy was not the reason: Turnout was a record 67 percent; some 600 million people voted over the course of six weeks, including an estimated 84 million first-time voters.

Yet if India’s democracy remains robust, Mr. Modi’s triumph does not bode well for it. Having campaigned five years ago as an economic modernizer, the charismatic prime minister this year offered a platform of nationalism and sectarianism. He boasted of his muscular response to a terrorist attack in Kashmir — though it’s not clear the planes he dispatched to bomb purported jihadist camps in Pakistan hit anything — and he appealed to Hindu chauvinism. The BJP pledged to take measures that would offend the country’s 180 million Muslims, such as constructing a Hindu temple on the site of a destroyed mosque. One of its new Parliament members is charged with a terrorist attack that killed Muslims and is on the record praising the assassin of Mahatma Gandhi.

Mr. Modi’s pivot toward populism can be explained by his mixed record in stimulating the economy. He introduced a couple of significant economic reforms, including a new bankruptcy law and a national sales tax, but he dodged others, including land and employment reform. Having promised to create 10 million jobs annually, he came nowhere close; instead, growth slowed and the unemployment rate rose to 6.1 percent last year, the highest in 45 years.

The government meanwhile pursued a distinctly anti-liberal agenda. Mr. Modi disparaged Indian media and did not hold a news conference in five years. Some critical journalists and nongovernmental organizations were pressured and intimidated. Attacks by Hindu extremists against Muslims rose steadily and were rarely punished.

The worry now is that Mr. Modi will take his resounding victory as a mandate to double down on Hindu nationalism, rather than pivoting back to the needed economic reforms. He could use some friendly cajoling from the United States, with which he has sought to build a closer relationship, if not an explicit alliance. Unfortunately, President Trump, a frank admirer of populists and strongmen, has had little but praise for Mr. Modi’s leadership and was quick to place a call of congratulations to him when the election results were announced. The message to Indians was clear: When it comes to defending their secular and democratic norms from further erosion, they can expect no help from this American president.