Trump, accompanied by first lady Melania Trump, stood behind the court's massive columns at the top of the court steps as people from the bottom of the steps loudly booed him and chanted, "Vote him out!"
Members of the public have been waiting for hours to file past the flag-draped casket, which will on Friday be moved to the Capitol building where Ginsburg will lie in state.
Standing a block away during the president's visit, they also shouted, "Honor her wish," according to a reporter traveling with Trump. Bystanders also chanted, "Respect her dying wish," as Trump's motorcade passed.
On Monday, without evidence, Trump baselessly asserted it had been made up by Democrats.
Later Thursday, White House press secretary Kayleigh McEnany dismissed the protesters. "The chants were appalling but certainly to be expected when you're in the heart of the swamp,” she told reporters.
Vice President Mike Pence and his wife, Karen, stopped by the court on Wednesday to visit the casket.
Ginsburg, an associate justice who became a historic influence on the court and an American icon, died on Friday. She was 87.
While Trump praised Ginsburg in the wake of her death, the next day his campaign began fundraising off the Supreme Court vacancy she left, and the president gleefully led chants of "fill that seat" at a campaign rally.
Trump and Senate Republicans have moved quickly to confirm a justice tor replace Ginsburg, with Trump pushing for a vote before the Nov. 3 election.
ABC News' Missy Olazagasti contributed to this report.