In recent months lawmakers have spared neither Facebook nor Mr. Zuckerberg. On Wednesday, that criticism became more than five hours of political theater, making it glaringly apparent just how skeptical of Facebook Congress has become through nearly three years of controversy.

The company now faces several investigations by regulators in a number of countries and by 47 state attorneys general, as well as increasing calls that it should be broken up into a number of smaller, less powerful companies.

Mr. Zuckerberg acknowledged his company has a trust problem. “I get that I’m not the ideal messenger for this right now,” he said. “We certainly have work to do to build trust.”

Despite occasional stumbles, Mr. Zuckerberg, accompanied by a nearly full front row of Facebook lawyers, top lobbyists and public relations executives, stayed calm under the harsh questioning. He did what he was supposed to do as the chief executive of a big company called to heel in Washington. He took the heat.

Mr. Zuckerberg still brightened when the grab-bag discussion veered into the technical details of Libra.