Trump made his remarks after speaking at the weekend with both Russian President Vladimir Putin and his Ukrainian counterpart, Volodymyr Zelenskiy.
He gave no specific reason for his assertion that a solution to the conflict was in sight, and overnight Russia hammered Kyiv and the surrounding region with missiles and drones, killing at least 28 people.
"This is one that I think we're getting much closer than people realise. And President Putin wants it to end. I will tell you that very strongly," Trump told reporters in the Oval Office.
Trump said he had held a "good call" with Putin on the Fourth of July holiday, a conversation a Kremlin aide said lasted 85 minutes and was marked by the US president offering to help find a way to move towards peace.
"And President Zelenskiy actually wants it to end now. And we're going to be going to NATO, and we're going to be talking about it, and I think we're going to get it," Trump said.
"I think we're going to get it ended. It's been a terrible situation."
Trump is scheduled to meet Zelenskiy on Wednesday on the sidelines of the NATO summit in Ankara and a US official said the idea of the talks was to make a renewed push to end the war.
The same official said Trump would likely follow up with Putin after talking to Zelenskiy.
In Moscow, Peskov said Putin and Trump had agreed to continue contacts "in the near future" and Moscow believed the US president held a consistent position on the conflict.
"You know, President Trump, the US president, has a fairly consistent stance, and all these fabrications about him supposedly changing his views like a weather vane are, of course, untrue," Peskov told reporters.
"He is consistent and confident in his understanding of what is happening, but, most importantly, he (Trump) is open to listening to the information that is conveyed to him by Putin."
Zelenskiy also described his weekend phone conversation with Trump as "very good".
In comments to the Financial Times, Zelenskiy said the US president had told him Ukraine "is doing very well" with its long-range drone campaign on Russian oil industry targets that has triggered fuel shortages inside the country.
"President Trump wants to be where there's success," the newspaper quoted Zelenskiy as saying.
"That's tied to many things - not only to his personality, but to the approaching (US midterm) elections, to his status, to his belief in how this war can be ended."
Meanwhile Russia pounded Kyiv and the surrounding region with missiles and drones early on Monday, killing at least 28 people, officials said.
Ukraine's military was unable to down any of the 23 ballistic missiles fired by Russia, according to air force data, reflecting its increasing vulnerability to Moscow's strikes as stocks of its prized Patriot missiles run out.
"As long as Patriot missiles sit in our allies' stockpiles, Russia is only encouraged to keep destroying residential buildings," Zelenskiy said on social media platform X.
"The US and Europe have the power to stop this terror."
At least 18 people were killed in Kyiv, the Emergency Services said on Telegram as search and rescue operations recovered more bodies and crews worked through the night.
Prosecutors said 10 people were killed in the wider Kyiv region while the governor of southeastern Zaporizhzhia region said a drone strike on a filling station killed two people.
And in Sumy region on the Russian border, where Moscow wants to broaden a buffer zone, the regional governor said two residents died in separate Russian drone strikes.
with DPA