US President Donald Trump has paid respects to late Supreme Court Justice Ruth Bader Ginsburg.

It comes just two days before he announces his nominee to replace her on the high court.

The president and first lady Melania Trump – both wearing masks – stood silently at the top of the steps of the court on Thursday morning and looked down at Ginsburg’s flag-draped coffin, surrounded by white flowers.

The death of the liberal-leaning justice has sparked a controversy over the balance of the court just weeks before the November presidential election.

Mr Trump has called Ms Ginsburg an “amazing woman” but some spectators were not happy that he came.

Moments after he arrived, booing could be heard from spectators who then briefly chanted: “Vote him out.”

Mr Trump walked back into the court as the chants grew louder.

As the motorcade returned to the White House, there were also chants of “Breonna Taylor” from some spectators.

Their calls came one day after it was announced a Kentucky grand jury had brought no charges against Louisville police for her killing during a drugs raid connected to a suspect who did not live at Ms Taylor’s home.

Supreme Court Ginsburg
US President Donald Trump pays his respects (Alex Brandon/Pool/AP)

Ms Ginsburg’s body will lie in state at the Capitol on Friday, the first time a woman has received that distinction and only the second time it has been bestowed on a Supreme Court justice.

William Howard Taft, who had also served as president, was also recognised in such a manner.

The body of Rosa Parks, a private citizen and not a government official, has previously lain in honour at the Capitol.

Ms Ginsburg will be buried alongside her husband Martin, who died in 2010, in a private ceremony at Arlington National Cemetery next week.

Meanwhile, the president is expected to announce his nominee to replace Ms Ginsburg on Saturday.

He has said he will select from a list of five women.

Republicans are working to move quickly to a confirmation vote, possibly even before the November 3 election.