WASHINGTON—The Senate opened the impeachment trial of President Trump on Thursday with Chief Justice John Roberts swearing in the senators, who pledged to deliver impartial justice, and the formal reading of the two charges of abuse of power and obstruction of Congress.

Hours before the senators took their oath, the Government Accountability Office, a watchdog agency, determined that Mr. Trump’s administration violated the law when it withheld aid to Ukraine, an issue at the heart of the impeachment case against the president.

Democrats allege that Mr. Trump, a Republican, improperly withheld the aid to pressure Kyiv to launch investigations that would help him politically in the 2020 election.

Mr. Trump has denied wrongdoing, calling the case against him a “big hoax” on Thursday. He is the third president in U.S. history to be impeached.

The GAO wrote that the White House Office of Management and Budget improperly froze Ukraine funding over the summer for policy reasons. It was later released after pressure from Congress. A spokeswoman for OMB said it disagreed with the GAO finding.