Polls close at 6pm (1230 GMT) in the seventh and final round of voting, ending the world’s biggest election with 900 million eligible voters from Goa’s beaches to Mumbai’s slums and Ladakh’s Himalayan monasteries.
Long queues formed outside polling stations in eight northern states electing the final 59 candidates to India’s 543-seat lower house.
Heavy security was imposed in West Bengal state, which has seen street battles between followers of Modi’s Bharatiya Janata Party and opposition groups.
The conservative BJP has campaigned aggressively on Modi’s strongman image and played up recent cross-border air strikes against Pakistan. But the opposition, led by the Congress party and its leader Rahul Gandhi, have accused him of pursuing divisive policies and neglecting the economy.
Modi and Gandhi have hurled insults at each other on a near daily basis with the prime minister calling his rival a “fool” while Gandhi derides Modi as a “thief”.
The animosity has taken a toll on voters.
“All the abuse and misconduct claims suggest that standards in Indian politics have slipped badly,” Asit Banerjee, a history teacher in Kolkata, said as he queued to vote.
“Endless mudslinging and bitter comments pervaded the campaign. We are losing hope in a democracy it is time for a reset,” the 60-year-old told AFP.
Writing in the Hindustan Times, political commentator Karan Thapar said that Modi’s message “played on our insecurities and strummed upon our deep inner fears”. He also criticised Gandhi’s campaign.
Pollsters say Modi remains personally popular but his party’s overall majority is at risk from a backlash against the government.
The 68-year-old Modi has held 142 rallies across India during the campaign, sometimes five per day, but pollsters say the BJP could lose dozens of the 282 seats it won in its 2014 landslide triumph.
All votes from the seven rounds will be counted on Thursday with the main trends to be announced the same day.
Hoping to become the fourth member of Nehru-Gandhi dynasty to lead India, Rahul Gandhi has struggled to make himself heard above the din of the BJP’s campaign juggernaut.
The Delhi-based Centre for Media Studies estimates that the outlay on this election could top $7 billion (Dh25.7 billion), making it one of the priciest contests globally — with the lion’s share of the spending by the BJP.
Lots of it has been spent on social media, with the parties using armies of “cyber warriors” to bombard India’s hundreds of millions of Facebook and WhatsApp users with messages.
Fake news and doctored images have abounded, including of Gandhi and Modi having lunch with Imran Khan, prime minister of arch rival Pakistan, or of a drunk Priyanka Gandhi, a politician and the sister of Rahul.
Violence has also broken out. Maoist rebels killed 15 troops and their driver in the western state of Maharashtra on May 1, the latest attack in a decades-long insurgency.
Gandhi, 48, has tried several lines of attack against Modi, in particular over alleged corruption in a French defence deal — he calls Modi a “liar” — and over the plight of farmers and on the economy.
Modi’s government has fallen short on creating jobs for the million Indians entering the labour market every month, the shock introduction of a cash ban in 2016 caused huge disruption to livelihoods, and Indian banks are gasping under bad debts.