Prime Minister Imran Khan on Thursday congratulated India’s premier Narendra Modi on his victory in the country's national elections.

"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," the prime minister said on Twitter.

Hours later, Modi responded to PM Imran's tweet, thanking him for his congratulatory message and saying that "I have always given primacy to peace and development in our region."

Modi claimed victory as results were being counted and vowed an "inclusive" future, with his party headed for a landslide win to crush the Gandhi dynasty's comeback hopes.

The BJP's main rivals Congress was far behind in the count, with Rahul Gandhi — the great-grandson, grandson and son of three premiers — suffering a humiliating loss in the Amethi seat held by India's once-mighty political dynasty for generations.

Read Indian election updates here.

Ties with Pakistan

Modi’s election victory was on the plank of national security, a campaign that gained strength in February when he sent warplanes into Pakistan to hit a suspected militant camp after a bomb attack in occupied Kashmir led to death of 40 Indian police officers.

India's move to send warplanes fanned the flames of nationalism and helped the BJP turn voters’ attention away from the flailing economy and onto matters of national security.

The airstrike “gave him the narrative he needed to counter all these allegations of non-performance, unemployment and rural distress. It reenergized him and enabled him to reclaim his image as a strong leader India needs at this juncture”, said political commentator Arti Jerath.

Last month, Prime Minister Imran had said there may be a better chance of peace talks with India if BJP wins the general election.

“Perhaps if the BJP — a right-wing party — wins, some kind of settlement in Kashmir could be reached,” the prime minister had told a small group of foreign journalists in an interview.