"This act of evil occurred as the victims and their families were in their place of worship. Our hearts are broken," Trump said on a visit to Japan.
"We pull together, we join arms ... through the tears and the sadness we stand strong," added the president, addressing business leaders on day two of his Asian trip.
A gunman stormed into a Baptist church during Sunday morning services and killed at least 26 people.
The shooter, whose motives were not immediately clear, was dressed all in black and wearing a ballistic vest, authorities said.
Though officials did not identify the gunman, multiple media outlets named him as Devin Patrick Kelley, 26, adding that he had been dishonorably discharged from the Air Force.
He was also found dead after the assault.
"We cannot put into words the pain and grief we all feel," added the president.
Trump's host, Japanese Prime Minister Shinzo Abe, tweeted his "deepest condolences", saying: "I wish to express heartfelt solidarity with the people of the United States during this difficult time."
He added: "My thoughts are with those who suffered injuries in the incident."
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)
Get the latest election news, live updates and election schedule for Lok Sabha Elections 2019 on ndtv.com/elections. Like us on Facebook or follow us on Twitter and Instagram for updates from each of the 543 parliamentary seats for the 2019 Indian general elections.