Trump was speaking at the formal dinner with Modi at the historic Blue Room of the White House.
"You know, the prime minister was going to come here at a different time, but we worked out this time because they had elections in a section of India.
"And it's just a small section," he said, apparently referring to Uttar Pradesh -- one of India's most populous states.
"But we said, it's the seventh largest country in the world, that small section of India. So I said, you know what, this is a better day. But it is great to have you," he said.
More From This Section
"And after many years, we've got three-fourth majority in the state assembly," Modi added.
The Bharatiya Janata Party had won the assembly elections in Uttar Pradesh by a landslide, securing over 300 of the total of 403 seats.
"You won by a lot," Trump said, lauding it as a "fantastic" victory.
Foreign Secretary S Jaishankar, when asked about the "delay", said the dates of the visit were never formal.
"As you know, the Prime Minister was too busy with the elections. It was a question of planning the trip between our friends and timed with a common calendar. It happened on June 26. If it was convenient, it could have happened a week before or a week later. I think it was nothing other than convenience," he said.
On the Indian side were Jaishankar, National Security Advisor Ajit Doval, and Indian Ambassador to the US Navtej Sarna.