Indian Prime Minister Narendra Modi was on track Wednesday to secure a third straight term as leader of the world’s largest democracy, but to remain in power he will now have to rely on his coalition allies — a situation that will likely affect his domestic reform agenda while leaving his foreign policy goals intact.

Following a six-week election that saw a record-breaking 642 million voters head to the polls, Modi’s Bharatiya Janata Party (BJP) lost its majority in the country’s 545-seat Lok Sabha — the lower house of parliament — after defeats in key states to an opposition coalition that performed better than expected and capitalized on key voter concerns.

While the BJP still emerged as the single largest winner, it secured just 240 of the 272 seats needed for a majority — well short of its 2014 and 2019 election tallies.