Indian prime minister Narendra Modi’s Hindu nationalist party claimed it won re-election with a commanding lead in Thursday’s vote count, while the head of the main opposition party conceded a personal defeat that signalled the end of an era for modern India’s main political dynasty.

Election Commission data by mid afternoon showed the Bharatiya Janata Party leading in contests for 299 out of 542 seats in the lower house of Parliament, with its main rival, the Indian National Congress, ahead in 50 contests.

The data did not indicate what percentage of the estimated 600 million votes cast over the six-week election had been counted.

Although the final tally was not expected until Thursday evening at the earliest, BJP President Amit Shah claimed a victory, crediting Mr Modi’s leadership.

Mr Modi himself tweeted: “India wins yet again.”

The election has been seen as a referendum on 68-year-old Mr Modi, whose economic reforms have had mixed results but whose popularity as a social underdog in India’s highly stratified society has endured.

Critics have said his Hindu-first platform risks exacerbating social tensions in the country of 1.3 billion people.

India Elections
Bharatiya Janata Party (BJP) supporters celebrate in their party’s Assam state office (Anupam Nath/AP)

On the campaign trail, Mr Modi presented himself as a self-made man with the confidence to cut red tape and unleash India’s economic potential, and labelled Congress party president Rahul Gandhi, the scion of a political dynasty that lost national power in 2014, as an out-of-touch member of the elite.

Mr Gandhi conceded defeat for his own parliamentary seat to his BJP rival in Amethi, a constituency in the north Indian state of Uttar Pradesh that had for decades been a Congress party bastion.

Congress, the party of India’s first prime minister, Jawaharlal Nehru, and peace activist Mahatma Gandhi, ruled India for nearly half a century after it achieved independence from Britain in 1947.

In 2014, it won only 44 seats, and was projected to win only slightly more this time.

The BJP’s performance “is absolutely stunning. Modi is the predominant leader in India today. He has pushed everybody else aside. Nobody in the opposition is a match for him”, said political commentator Arti Jerath.

A party or coalition needs a simple majority of 272 seats, or just over half the seats in Parliament’s lower house, to govern.

“Mr Modi’s going to be the next prime minister, we are very assured of that,” said Meenakshi Lekhi, a member of Parliament running for re-election in New Delhi.

Shortly after officials began tabulating the votes, India’s Sensex jumped 2.3% to an all-time high over 40,000, though it closed Thursday off 0.76% at 38,811.

If BJP’s lead holds, it will not need a coalition partner to stay in power and could even improve its position compared to 2014, when it won 282 seats.

This election may mark the first time in the party’s history that it has won two consecutive elections on its own.

World leaders, including Israeli prime minister Benjamin Netanyahu, Chinese President Xi Jinping, Pakistan prime minister Imran Khan and Sri Lankan President Maithripala Sirisena, congratulated Mr Modi on Twitter.

“I congratulate Prime Minister Modi on the electoral victory of BJP and allies. Look forward to working with him for peace, progress and prosperity in South Asia,” Mr Khan tweeted.

Trends in the election data suggest that BJP’s strategy of pursuing an aggressive campaign in eastern India paid off, with the party breaking into the citadels of Trinamool Congress Party in West Bengal state and the Biju Janata Dal in Odisha state.

Picking up seats in these two states would compensate for projected losses in Uttar Pradesh in northern India.

The biggest losers appear to be the communists who ruled West Bengal state for 34 years until they were ousted by Mamata Banerjee’s Trinamool Congress Party in 2011.

Coalition partners of the Congress-led government in New Delhi between 2004 and 2008, the Communist Party of India (Marxist) was leading in only three constituencies and the Communist Party of India in two constituencies.

Outside BJP headquarters in New Delhi, hundreds of people cheered and shouted party slogans, lifting cardboard cutouts of Mr Modi and Mr Shah into the air as other people played drums and set off fireworks.

Mohit Sharma, a 29-year-old who runs a bathroom fittings business, said India had never had a prime minister like Mr Modi.

“In the past, when leaders after they won elections, they sat in air-conditioned rooms and they never reached out to people, but Modi was never like that. He was always connected to the people through social media,” Mr Sharma said.

Fashion designer Sandeep Verma, 39, said he was not a BJP supporter but voted for the party in the elections.

“A country like India needs a decisive leader and the people did not find that in Rahul Gandhi. There was no alternative to Modi,” Mr Verma said.

The BJP harnessed social media, including Twitter, where Mr Modi has 47.4 million followers, and WhatsApp to reach out to millions of supporters.

India Elections
India’s ruling Bharatiya Janata Party (BJP) President Amit Shah displays the victory sign (Manish Swarup/AP)

Mr Modi also capitalised on a suicide bombing in Kashmir in February that killed 40 Indian soldiers.

India retaliated with airstrikes at alleged terrorist training camps in Pakistan, fanning the flames of nationalism and helping the BJP turn voters’ attention away from the flailing economy and onto matters of national security.

As votes were being counted across India, Pakistan’s military said it successfully test-fired a long-range ballistic missile capable of carrying a nuclear warhead.

Tensions with Pakistan “gave him the narrative he needed to counter all these allegations of non-performance, unemployment and rural distress. It reenergised him and enabled him to reclaim his image as a strong leader India needs at this juncture,” Ms Jerath said.

India Elections
Counting officials open electronic voting machines (EVM) (Bikas Das/AP)

Analysts also said that Mr Modi’s victory could embolden Hindu hard-liners calling for Hindu cultural practice to colour more of India’s laws and norms.

BJP candidate Sadhvi Pragya, a Hindu holy woman who is awaiting trial on charges connected to a 2008 bombing that targeted Muslims, and who recently called independence leader Mahatma Gandhi’s assassin a “patriot”, was leading the polls in Bhopal.

At Congress headquarters, a few party workers stood outside looking dejected.

Jagdish Sharma, 50, blamed the counting method, using electronic voting machines, saying “Rahul Gandhi is the crowd’s favourite, but has always lost only due to EVMs. While EVMs exist even Lord Vishnu can’t defeat Modi,” he said, referring to a powerful Hindu god.

Voters cast ballots on some 40 million electronic voting machines, a method India began using 15 years ago after complaints that the manual count of paper ballots was tainted by fraud and abuse.

India Elections
A BJP supporter displays a sari with a portrait of prime minister Narendra Modi (Mahesh Kumar A/AP)

But losing candidates and political parties have raised doubts about the accuracy and reliability of the electronic method, doing so again this week.

Top opposition leaders met with Election Commission officials on Tuesday after videos appeared on social media showing some electronic voting machines being moved.

The party officials alleged that the machines were going to be altered, but the commission said the images showed unused machines being moved into storage.