India's ruling party looked set to lose power in three key states, official vote counts showed on Tuesday, likely handing Prime Minister Narendra Modi his biggest defeat since he took office in 2014, and only months ahead of a general election. The results in the heartland, rural states of Rajasthan, Chhattisgarh and Madhya Pradesh could force the federal government run by Modi's Hindu nationalist Bharatiya Janata Party (BJP) to lift spending in the countryside, where more than two-thirds of India's 1.3 billion people live. Political analysts say the BJP's likely defeat underscores rural dismay with the government and could help unite the opposition led by the Congress party, despite Modi's high personal popularity, in the face of criticism he did not deliver jobs for young people and better conditions for farmers. "We've all voted for Congress this time and our candidate is winning here," said Bishnu Prasad Jalodia, a wheat farmer in Madhya Pradesh, where the Congress was ahead of the BJP and only slightly short of the majority needed to rule "BJP ignored us farmers, they ignored those of us at the bottom of the pyramid." The elections are also a test for Rahul Gandhi, president of the left-of-centre Congress, who is trying to forge a broad alliance with regional groups and present Modi with his most serious challenge yet, in the election that must be held by May. In Rajasthan, the Congress was leading in 100 of the 199 seats contested, against 65 for the BJP, according to data in by the early evening from the Election Commission. In Chhattisgarh, Congress was ahead in 62 of the 90 seats at stake, with the BJP at 13. In Madhya Pradesh, the most important of the five states that held assembly elections over the past few weeks, Congress was leading with 115 seats while BJP had 105 out of 230. Read Also| Chhattisgarh election result: Loan waiver promise proved biggest gamechanger for Congress Regional parties were leading in two smaller states that also voted, Telangana in the south and Mizoram in the northeast. Congress said it was confident of forming governments in all of the three big states. The BJP had been ruing in all three, for three terms in two of them. The BJP said the state results would not necessarily dictate what happens in next year's general election. Investors said the BJP had not fared as badly as feared, and nationally it would still likely have an edge over an opposition coalition in the general election. Markets recovered from sharp early losses, though the central bank governor's resignation on Monday kept investors nervous. GOODWILL LOST Local issues usually dominate state polls, but politicians and analysts are seeing the elections as a pointer to the national vote just months away. "A disappointing set of state election results . suggests that the ruling national party has lost some goodwill and the risk now is that, in response, fiscal (and potentially even monetary) policy is loosened ahead of the general election when the economy is already running into capacity constraints," London-based economic research consultancy Capital Economics said in a note. "That said, we maintain our view that the BJP will secure victory in the general election, which would allow PM Modi to get his reform agenda back on track after a lacklustre 2018." Gandhi, the fourth generation scion of the Nehru-Gandhi dynasty, has sought to build a coalition of regional groups, some headed by experienced firebrand, ambitious politicians. Congress has already said it would not name Gandhi, who is seen as lacking experience, as a prime ministerial candidate. A lawmaker for the BJP said it had erred in focusing its campaign on partisan themes, such as building a Hindu temple at a site disputed by Muslims, instead of offering jobs and growth. "I knew we would lose in Rajasthan and Chhattisgarh but Madhya Pradesh trends have come as a surprise," Sanjay Kakade, a BJP member of parliament told the Reuters partner ANI media outlet. "We forgot the issue of development that Modi took up in 2014."