LONDON — Prime Minister Narendra Modi pledged to work "even harder" for the Indian people Thursday as he looked set to secure a decisive electoral victory, setting up his Hindu nationalist party to govern India for another five years.

The Bharatiya Janata Party (BJP) — which critics say has aggravated religious tensions in India — was on course to win more than 300 of the 542 seats available, according to the Election Commission of India.

That would be more than the 282 it won in the last general election in 2014 and more than the 272 seats needed for a majority in India’s Parliament.

"Thank you India!" Modi tweeted Thursday. "The faith placed in our alliance is humbling and gives us strength to work even harder to fulfill people's aspirations."

Meanwhile, main opposition Congress party leader Rahul Gandhi conceded the loss of his parliamentary seat, according to The Associated Press.

“I don’t think even in the wildest dreams of BJP leaders they thought they would do this well,” said Sayan Banerjee, a political scientist at the University of Essex who focuses on India and South Asia, cautioning that all the votes were yet to be counted.

The election is the world's largest democratic exercise, with some 900 million people eligible to cast their votes over six weeks in the country of 1.3 billion people.

The vote was seen as a referendum on Modi, whose economic reforms have had mixed results, but whose roots as a social underdog in India’s highly hierarchical society boosted his popularity. The son of a tea seller, Modi was propelled to power in 2014 and has presented himself as a pro-business leader who is strong enough to defend the country against Pakistan, India’s Muslim-majority archrival.

Despite its reputation as the party for upper classes, in 2014 Modi was able to transform the BJP into the party of the marginalized, K. C. Suri, who teaches political science at the University of Hyderabad, said. "He broke that image, drawing support from the poorer classes," he said, adding that the results would likely show that Modi had achieved this again.

The success of the BJP comes off the back of a flare-up of long-standing tensions between nuclear-armed enemies India and Pakistan. Earlier this year, Pakistan-based militants killed dozens of Indian troops in the disputed region of Kashmir. Modi responded by launching airstrikes targeting what New Delhi said were militant training camps in Pakistani territory.

Going into the polls, India-watchers might have expected the BJP to be penalized for their economic record, according to Katharine Adeney, director of the University of Nottingham Asia Research Institute. "Modi was going to get Indians jobs and there are lots and lots of young Indians without jobs," she explained.

However, she said, Modi successfully framed this campaign around national security, particularly following the attack in Kashmir. "He brought up national security repeatedly in his speeches, he portrayed himself as the watchman of India and this has been shown to play extremely well with the Indian electorate," she added.

Banerjee agreed that the flare-up in Kashmir had helped Modi's campaign. “This definitely turned the tide and projected Modi as a strong leader,” Banerjee said. “It was definitely appreciated by BJP voters who were wavering.”

The poor showing by the opposition Congress party will raise questions about the leadership of Gandhi, a scion of the Nehru-Gandhi dynasty whose father, grandmother and great-grandfather all served as prime ministers.

An Indian member of the Dravida Munnetra Kazhagam party (DMK) celebrates as results came in for India's general election in Chennai. Arun Sankar / AFP - Getty Images

“Gandhi is seen as runner-up in terms of strength and charisma compared to Narendra Modi,” Banerjee said. “The dominant narrative is that Gandhi is a rich guy from a famous political party … people feel that he doesn’t deserve it and he doesn’t get what the people want.”

The other parties presented the fight as one to unseat Modi, Suri said. "Either you were for Modi or opposed to him and I think that favored Modi in the end," he added.

As for what a landslide victory for the BJP could mean for India, critics have said Modi’s Hindu-first platform risks exacerbating social tensions in the country where Hindus comprise about 80 percent of the population.

"Life could become more uncomfortable for Muslims in terms of rhetoric, relations with neighbors and in terms of civil rights," in some regions of the country, Banerjee said.

The dominant socially-conservative wing of the BJP hopes to turn the structure of Indian society from a caste-based hierarchy to a cleavage based on religion, he said. This is because it would help them retain power in the future, he added.

However, Banerjee cautioned, that vision would be difficult to achieve in a country where the caste structure is deeply rooted.

Adeney said Modi's campaign was polarizing and demonized Muslims. She said she was concerned that under the governance of the BJP, India would continue to see attacks on Muslims, particularly regarding the issue of "cow protection." The animals are revered in India so rumors of slaughtering, eating or transporting cows for that purpose can stir deep rage and mobs of so-called cow protectors killed at least 20 people last year.

Suri said the BJP and the Congress party had different visions of how India should work. The Congress party, he said, could be best understood as promoting a secular, plural and inclusive state based loosely on the Western idea of multiculturalism.

However, he said the BJP promoted what he described as “a different imagination” of India where all citizens should be treated equally but at the same time India should be a Hindu nation.

“The basic ideology of the BJP is to unite Hindus into a strong nation,” Suri said, adding that they believe that whoever lives in India is a Hindu, regardless of religion.