The Western Wall is the holiest site where Jews can pray. Trump, wearing a black skullcap, paused in front of it, then placed what appeared to be a written prayer or note between its stones, as is custom.
He was not accompanied by any Israeli leaders.
Allowing them to do so could have led to accusations that Washington was implicitly recognising Israel's unilateral claim of sovereignty over the site, which would break with years of US and international precedent.
Security was tight, with the usually bustling Old City, where the Western Wall is located, essentially on lockdown and the plaza leading to the site cleared.
Trump was accompanied by the Western Wall's rabbi, Shmuel Rabinovitz, during the visit.
Trump's daughter Ivanka, who converted to Judaism and is married to one of the president's top aides, Jared Kushner, also visited the women's side of the wall.
Trump, who is Protestant, is the first US president to have Jewish members of his immediate family.
Under strict interpretation of Jewish law, men and women must pray separately there. The rule has been repeatedly challenged by progressive Jewish movements seeking equal prayer rights.
The Western Wall is the last remnant of the supporting wall of the second Jewish temple, built by King Herod and destroyed by the Romans in 70 AD.
It is situated below the Al-Aqsa mosque compound, Islam's third-holiest site, referred to by Jews as the Temple Mount and considered their holiest.
The status of Jerusalem is ultra-sensitive and has been among the most difficult issues in Israeli-Palestinian peace talks.
Israel occupied east Jerusalem, where the Western Wall is located, and the West Bank in 1967 in moves never recognised by the international community.
It later annexed east Jerusalem and claims the entire city as its capital. The Palestinians see east Jerusalem as the capital of their future state.
The traditional US position has been that Jerusalem's status must be negotiated between the two sides.
Trump's visit to the wall came as part of his first trip abroad as president. The trip includes stops at important sites for Christians, Muslims and Jews.
The first leg of his trip was in Saudi Arabia, while later stops will include the Vatican.
Before visiting the Western Wall, Trump toured the nearby Church of the Holy Sepulchre, built at the site where Christians believe Jesus was crucified, buried and resurrected.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)