Melania Trump at the Republican National Convention on July 18, 2016 in Cleveland. (Photo by Chip Somodevilla/Getty)

HAMBURG — Much of the G-20 summit is about optics: carefully orchestrated handshakes and outings, among world leaders but also among their spouses.

So protesters eager to frustrate summit proceedings notched a victory Friday when they blocked Melania Trump from exiting the German government guesthouse where she and President Trump are staying in Hamburg. It was among the most high-profile disturbances in a chaotic security situation, as police officers in riot gear, reinforced by armored vehicles, sought to shield the summit from widespread demonstrations.

Trump was unable to join other spouses for a tour of Hamburg's harbor, which was expected to precede a visit to a climate research center. The venue for the second part of the gathering had to be changed, due to traffic blockades mounted by the protesters.

Police secure the area around the accomodation where U.S. President Donald Trump and First Lady Melania Trump will stay during their visit to the G20 summit on July 7, 2017 in Hamburg, (Alexander Koerner/Getty)

Stephanie Grisham, the first lady's spokeswoman, said police were unable to secure the surroundings to allow Trump to leave.

“She was prevented from participating in today's spousal program, which she was looking forward to,” Grisham said in a statement.

Trump herself tweeted well-wishes for those injured in widespread demonstrations across the German port city, where two days of summit meetings began Friday.

Abby Phillip contributed to this report.

Police used water cannons against thousands of anti-capitalist protesters in Hamburg, Germany on July 6, the day before the start of the G-20 summit. (Reuters)