Modi added that both the nations had agreed to increase their cooperation to tackle global challenges like increasing radicalization, extremism, and terrorism.
His comments came hours after the US on Monday declared the Pakistan-based Hizbul Mujahideen leader Syed Salahuddin a global terrorist.
Modi said that India was committed to peace in Afghanistan and rebuilding that country was a top priority.
"India and US are working together to bring stability and peace in Afghanistan," he said.
He also said that he and Trump agreed to work closely on boosting maritime trade and cooperation.
Modi said that the best of India's benefits lay in a strong and successful America.
Stating that he and Trump held talks on a wide range of issues pertaining to the India-USA relationship, he said: "We consider America a valued partner in our flagship programmes.
The Prime Minister said that trade, commerce, and investment were key areas of cooperation between the two sides.
"Technology, innovation and knowledge economy are also areas we are actively looking at," he said.
"Increasing productivity, job creation and breakthrough technologies will be the driving force of our ties."
Modi also invited Trump to visit India along with his family.
On his part, Trump said that both India and the US have been struck by the evils of terrorism, "and we are both determined to destroy terrorist organizations and the radical ideology that drives them."
"We will destroy radical Islamic terrorism," he said. "Our militaries are working every day to enhance cooperation between our military forces. And next month, they will join together with the Japanese navy to take place in the largest maritime exercise ever conducted in the vast Indian Ocean."
The President said that he "always had a deep admiration for your country and for its people, and a profound appreciation for your rich culture, heritage, and traditions".
"This summer, India will celebrate the 70th anniversary of its independence, and on behalf of the United States, I want to congratulate the Indian people on this magnificent milestone in the life of your very, very incredible nation," he said.
"During my campaign, I pledged that if elected, India would have a true friend in the White House. And that is now exactly what you have -- a true friend."
Trump said that he looked forward to working with Modi to create jobs in both countries, to grow both economies, and to create a trading relationship that was fair and reciprocal.
"It is important that barriers be removed to the export of US goods into your markets, and that we reduce our trade deficit with your country," he stated.
He said that the US was looking forward to exporting more energy to India as its economy grew, "including major long-term contracts to purchase American natural gas, which are right now being negotiated, and we will sign them".
Monday's talks were preceded by a one-on-one meeting between Modi and Trump in the Oval Office.
"President Trump has welcomed me with immense warmth. I thank him for the welcome. This is an honor for the 1.25 billion people of India," Modi told the media ahead of the meeting.
Trump said it was "a great honor" to host Modi "who has been such a great PM".
"You have done a great job economically and you are doing well in so many ways. I would like to congratulate you," the US President said.
Modi was welcomed by Trump and his wife Melania at the White House and was accorded a red carpet welcome. Both leaders warmly shook hands and smiled in what was their first-ever meeting.
Prior to Monday's meeting, Modi had spoken to Trump thrice over the phone after the latter assumed office in January this year.
Earlier in the day, US Defense Secretary James Mattis and Secretary of State Rex Tillerson paid courtesy calls to Modi here.
Read more news:
Indian-origin Google AR executive joins Facebook
U.S., India Going To Be Substantially Closer: American Official