Justice Neil M. Gorsuch walks away with wife Louise at the Supreme Court following an investiture ceremony Thursday. (Ricky Carioti/The Washington Post)

Neil M. Gorsuch was officially officially sworn in as the Supreme Court’s newest justice Thursday, with President Trump and first lady Melania Trump visiting the court for the first time to witness the investiture of the president’s nominee.

Gorsuch joined the court on April 10, and he took oaths at the court and at the White House. But the short and formal investiture follows a historic script, comes before a courtroom filled with family, friends and supporters, and culminates in the public debut of the new justice on the Supreme Court’s marble steps.

At the ceremony, the president is seen but not heard, and Trump followed that tradition. The Trumps sat with 97-year-old retired justice John Paul Stevens. But they also met privately with the justices beforehand and signed the court’s visitor book.

The swearing-in happened to come as the Supreme Court is considering whether to revive Trump’s executive order halting immigrants from six mostly Muslim countries. As soon as the ceremony ended, acting solicitor general Jeffrey B. Wall submitted a brief explaining why two appeals courts were wrong to stop the order before it took effect.

The court was also filled with White House and Justice Department officials, Republican former attorneys general and GOP senators who played a role in Gorsuch’s confirmation. No business was conducted during the six-minute ceremony.

“I want to extend to you and the first lady a warm welcome,” Chief Justice John G. Roberts Jr. told the Trumps from the bench.

As has each new justice since 1972, Gorsuch sat in a mahogany and leather chair used by Chief Justice John Marshall from 1819 to 1835. When he was called forward to the bench, the 49-year-old Coloradan shook hands with each of his now-familiar colleagues. Earlier this week, he delivered his first Supreme Court opinion.

The oath, by now, is also familiar to Gorsuch, and he ended with an emphatic “So. Help. Me. God.”

Then, about the time Trump was arriving back at the White House, Gorsuch and Roberts descended the Supreme Court steps to a waiting group of photographers and tourists gathered on the sidewalk. Gorsuch, wearing a blue suit and rust-colored tie, posed with Roberts, and then was joined by his wife, Louise Gorsuch, who wore bright red and delivered a chaste kiss.