The crosstown trip was excoriated by several Catholic leaders, including Archbishop Wilton D. Gregory of Washington, who said he found it "baffling and reprehensible that any Catholic facility would allow itself to be so egregiously misused and manipulated in a fashion that violates our religious principles" by allowing the visit.
The Trumps' visit to the shrine in Northeast Washington came on the 41st anniversary of the start of St. John Paul II's pilgrimage to his native Poland, the first trip by the pope during which he repeatedly addressed religious and political freedom.
The White House said the president offered no remarks during the visit. Secretary of State Mike Pompeo accompanied the Trumps during the brief stay at the shrine.
About 100 people, including children and their parents, had gathered near the shrine and began chanting slogans calling for justice for George Floyd, an unarmed black man who died in police custody in Minneapolis May 25.
Archbishop Gregory said Catholic teaching calls the faithful to "defend the rights of all people, even those with whom we might disagree."
The evening before the shrine visit, Trump walked from the White House to St. John Episcopal Church, which was set afire during protests May 31 that called for the nation to address racism and police violence.
Authorities fired flash-bang shells, gas and rubber bullets to disperse a crowd that had gathered in Lafayette Square across from the White House so Trump could walk to the church, where he held up a Bible as photographers captured the scene.
The crowd was present in the park to protest the death of Floyd and other African American people at the hands of police.
Archbishop Gregory questioned the decision to disperse the protesters in such a manner.
"St. John Paul II was an ardent defender of the rights and dignity of human beings. His legacy bears vivid witness to that truth. He certainly would not condone the use of tear gas and other deterrents to silence, scatter or intimidate them for a photo opportunity in front of a place of worship and peace."