The oath reads: “I solemnly swear that in all things appertaining to the trial of the impeachment of Donald John Trump, president of the United States, now pending, I will do impartial justice according to the Constitution and laws: So help me God.”

After Chief Justice Roberts took his oath, read to him by Senator Charles E. Grassley, Republican of Iowa, he turned to the senators in the chamber and asked them to do the same. Then, the senators signed their name in an oath book.

Trump said he wants a short trial.

Aides said Mr. Trump was not watching the ceremonial events on television as the trial got underway. But after an event in the Oval Office celebrating National Religious Freedom Day, the president told reporters that he hoped the trial would not last long.

“I think it should go very quickly,” Mr. Trump said. “It’s a hoax, it’s a hoax. Everybody knows that.”

Mr. Trump has vacillated between favoring a short trial or a longer spectacle that could be used as an opportunity to present his side of the story.

White House officials and senior senators have predicted the trial will last two to six weeks. The impeachment trial of former President Bill Clinton was five weeks long.

The day began with a federal office declaring that the president broke the law in withholding aid from Ukraine.

An independent federal watchdog, the Government Accountability Office, found that the Trump administration broke the law when it withheld millions of dollars in security assistance to Ukraine. The report, released Thursday, cited a violation of a 1974 law that protects the spending decisions of Congress. The White House budget office rejected the finding.