The Congress party was eviscerated.

Results for the opposition Indian National Congress party, once an unbeatable political force — it led India to independence, counted Gandhi as a member and governed for most of the decades since — were dismal. By Thursday evening, the party had won or was leading in just 51 seats, a small improvement from 2014 but still one of its worst showings ever.

As reality set in on Thursday evening, Congress leaders said they needed to revamp their approach to elections. They admitted that the B.J.P. had raised more money and run a superior campaign. Rahul Gandhi, the head of Congress and the great-grandson of India’s first prime minister, conceded defeat in a brief news conference in New Delhi. Looking heartbroken, he told supporters to prepare for a long battle ahead.

“I said during the campaign that the people were the masters, and today they have given their verdict,” he said.

Mr. Gandhi, 48, is seen by many voters as a lightweight compared with Mr. Modi, and has struggled to compete with his much more assertive and intense rival. Of the two Parliament seats Mr. Gandhi contested, he lost one in northern India that the Gandhi family had held for many years.

In just one sign of how dire things have become for the party, Mr. Gandhi offered to resign as party leader, according to India Today, a major news outlet.

The markets like Modi.

Many investors are confident that another Modi government will be good for business, and his victory was seen as a vote for stability. During his first term, Mr. Modi simplified a byzantine tax system, cracked down on corruption and overhauled India’s corporate bankruptcy system.

After it became clear that Mr. Modi’s government was returning to power, India’s stock market shot up 2 percent, to a record high.