HAMBURG, Germany — Littered streets were lined by police officers outside the Elbphilharmonie concert hall here on Friday evening after a concert put on for world leaders attending the Group of 20 summit meeting.

Inside the security bubble: Beethoven. As the conference’s host, Chancellor Angela Merkel of Germany had corralled the participating leaders for a performance of his Ninth Symphony, with its choral “Ode to Joy” finale invoking a utopian world in which “all men become brothers.” According to a government spokesman, the piece represented “a hymn to humanity, peace and international understanding.”

Inside the glittering new waterfront hall, President Trump lightly bobbed his head along to the boisterous scherzo. Next to him, President Emmanuel Macron of France leaned forward, on the edge of his seat. Canada’s first couple snuggled close, holding hands. President Vladimir V. Putin of Russia, who arrived late and slipped into an aisle seat, sat perfectly still, arms crossed.