Exits polls suggest Narendra Modi has secured a second term as prime minister of India, as voting closed in a marathon six-week election that was the largest democratic exercise the world has ever seen.

The vote was clearly defined by all sides as a referendum on the first five years in office of Mr Modi and his Hindu nationalist Bharatiya Janata Party (BJP) government, which has tried to modernise the economy and maintain growth while tensions between religious communities have grown.

The election began on 19 April and was held in seven phases, with the final 59 of 543 parliament seats voting on Sunday. Counting will take place on Thursday, and official results are expected the same day.

Four national surveys released as the last polling stations shut suggested Mr Modi’s right-wing, BJP-led coalition – the National Democratic Alliance (NDA) – had secured victory albeit with a reduced majority, from its 341 seats to between 280 and 315.

The main opposition Congress party, which with 44 seats suffered the worst result in its history at the last election in 2014, was projected to secure 124 to 128 constituencies with the help of its allies.

Exit polls in India have been badly wrong in the past and analysts warned there was likely to be a large margin of error this time round as well, such is the scale of the election with more than 900 million eligible voters.

Among the last to cast their ballots were residents of several key seats in the populous bellwether state of Bihar, which was part of the so-called Hindi heartlands swept by the “Modi wave” of 2014.

Distress among farmers and rising unemployment levels are seen as the biggest factors putting pressure on Mr Modi during the campaign, and the impoverished state has both a high percentage of rural voters and a poor track record of development.

Outside a polling station at a village primary school in the farming district of Fatuha, 23-year-old Mantu Kumar told The Independent he voted BJP in the last election, but that he voted Congress this time round as Mr Modi’s pledge to create 20 million jobs had not materialised.

“In 2014 there was a wave in favour of Modi – this time there is nothing like that,” he said. “Modi was a vote for change. We thought things would get better but they didn’t. When it comes to appearances he is good, but when it comes to his promises he has not delivered anything.”

In the expanding urban areas of Patna, the state capital, support for Mr Modi was much stronger, however. Voters here were as likely to talk about the prime minister’s record on national security – his number one talking point in the last five months of campaigning – as they were jobs and infrastructure.

After a separatist militant killed 40 Indian soldiers in Pulwama, Kashmir, Mr Modi ordered India’s first air strikes on Pakistani soil in decades. Though the efficacy of the strikes has been questioned, there is no doubt the action he took has resonated well with his supporters.

Outside Patna College, general store owner Sanjay Chandra, 38, said: “The country has grown stronger under Modi’s governance. The world has got the message thanks to Modi’s leadership that we too are a strong country.

“I hope he delivers more for the people… but the most important issue is the terrorism in this country. Only Narendra Modi can tackle this.”

While voting passed at a brisk pace and without any reports of clashes in Bihar, in neighbouring West Bengal police used batons to break up skirmishes between BJP supporters and those of the regional Trinamool Congress party on the outskirts of the state capital Kolkata. Several crude bombs were also exploded during the clashes, the police said.

The state has seen the worst of the violent clashes throughout the election, as the BJP has pushed hard to make inroads ahead of expected losses of seats in other large states like Uttar Pradesh, with its 80 seats up for grabs, and Bihar itself. West Bengal sends 42 members to parliament’s lower house.

Mr Modi visited West Bengal 17 times throughout the campaign, his visits in part provoking the sporadic violence that forced the Election Commission to cut off campaigning a day earlier than scheduled – a move analysts described as unprecedented.

Varanasi, Mr Modi’s own constituency, was also among the last seats to vote in Sunday’s seventh phase. While the prime minister faced little opposition on his home turf, early riser Ramesh Kumar Singh said he was “surprised to see [the level of] enthusiasm among the voters”.

Independent Minds Events: get involved in the news agenda

“There were long queues of people waiting patiently to cast their votes, which is a good sign for democracy,” he told the Associated Press.

With his rhetoric against Pakistan and appeals to the BJP’s Hindu core, Mr Modi has been accused of failing to speak out in defence of India’s large Muslim minority. Incidents of violence against Muslims in the name of cow protection have increased, and Kashmiri Muslims faced a backlash across India in the wake of February’s Pulwama bombing.

If the exit polls are correct and Mr Modi is indeed returning for a second term, voters like Shahla Hasan in the Muslim-majority Bhanwar Pokhar neighbourhood of Patna city were worried.

A 30-year-old business graduate who is nonetheless without a job, Ms Hasan took issue with Mr Modi’s claim that educated young people who cannot find employment should “go sell pakodas [street food]”.

But she is more worried about what she calls the rise of religious and caste divides on his watch. “Modi is anti-Muslim. Definitely. There is no doubt about it,” she told The Independent. “He talks about banning triple talaq, banning the burqa, banning loudspeakers in mosques.

“When it was Congress [in power] it was never like this – we are equal citizens of an independent nation, we shouldn’t have to tolerate it. If he comes back for a second time he won’t be the prime minister, he will be like Hitler – a dictator.”