BERLIN — Europe and the rest of the world were united in shock on Monday evening, as images of the burning Notre Dame Cathedral in Paris flooded social media and captivated TV audiences. In a Europe where deep political divisions have emerged in recent years, politicians offered a rare show of unity, largely drowning out conspiracy theories and alarmist voices that had gained some momentum in the early hours of the fire on Monday evening.

In their initial responses, many European leaders emphasized how much the history of Notre Dame was intertwined with their own.

António Guterres, the United Nations secretary general, said Notre Dame was “a unique example of world heritage.” Jean-Claude Juncker, president of the European Commission, similarly emphasized the cross-border significance of the cathedral, saying that it belonged “to the whole of mankind.”

In Britain, Prime Minister Theresa May wrote that her thoughts were with the French emergency services. Queen Elizabeth II said she and Prince Philip were “deeply saddened” by the events. “My thoughts and prayers are with those who worship at the Cathedral and all of France at this difficult time,” she wrote.

Pope Francis watched the Catholic Church’s French symbol go up in flames “with shock and sadness,” the Vatican said. A spokesman for German Chancellor Angela Merkel tweeted the term “Fluctuat nec mergitur” — Latin for “she is rocked by the waves, but does not sink,” a long-held slogan of Paris.

But there were some signs that the show of unity may be challenged in the days ahead. By Monday evening, some far-right politicians had already raised doubts over the French authorities’ initial assessment that the fire was caused by an accident. Meanwhile, French commentators argued that the money donated for the cathedral’s reconstruction would be better spent on people in need, reflecting a bitter dispute between French President Emmanuel Macron and protesters who have accused him in recent months of being out of touch with ordinary citizens.

While foreign leaders have at times portrayed those intra-European divisions as a sign of an old continent in trouble, reactions to the Notre Dame fire were markedly different — bridging not only domestic divides but also geopolitical fault lines.

In the United States, the view of a burning Notre Dame Cathedral resulted in rare agreement among the two 2016 presidential candidates. “So horrible to watch,” President Trump commented. “My heart goes out to Paris,” Hillary Clinton wrote.

“Notre Dame is a symbol of our ability as human beings to unite for a higher purpose — to build breathtaking spaces for worship that no one person could have built on their own,” Clinton added.

The Elysee presidential palace in Paris also received messages of support from leaders it does not consider to be allies. Russian President Vladimir Putin offered to send experts to help with the cathedral’s rebuilding, according to the Kremlin press office. Putin called Notre Dame an “invaluable treasure of the European and world culture, one of the most important Christian shrines.”

Feelings of disbelief upon seeing Notre Dame in flames were also shared by many officials in countries with majority-Muslim populations. Iranian Foreign Minister Mohammad Javad Zarif said he was “saddened” to see an “iconic monument” burning that was “dedicated to the worship of our one God.” The Egyptian Foreign Ministry echoed Zarif’s remarks, writing that it had followed the blaze with “pain and sorrow.”

Meanwhile, the World Jewish Congress said its members hope that the heavily damaged cathedral “can be restored to allow this unparalleled structure to return to its position of symbolic majesty on the Parisian skyline.”

But as world leaders emphasized the historic significance of Notre Dame, some commentators pointed at other historic events to justify feelings of schadenfreude — sparking a fierce backlash on social media. For many Chinese, the burning of Notre Dame evoked a painful episode in the country’s history: the torching of the Old Summer Palace by French and British troops in 1860 during the Second Opium War.

The palace complex in Beijing, called “Garden of Perfect Brightness” in Chinese, was built in the 18th and early 19th centuries for the Qing dynasty emperor Qianlong. It was renowned for its huge gardens, which covered more than 800 acres, and its works of art.

But when the Chinese resisted French and British attempts to force the country to open, the British high commissioner to China, Lord Elgin — the same envoy responsible for taking marble from Greece to Britain — ordered the destruction of the palace.

“More than a hundred years ago, the British and French allied forces burned the Old Summer Palace. . . . Now it’s their turn,” a person using the screen name yingbufuxingdemaogege wrote on Weibo, China’s version of Twitter.

But other Weibo users criticized such sentiments. “The fire at Notre Dame cathedral directly damaged human civilization, and indirectly insinuated the backwardness of China’s education system,” wrote VincentTwoMinds.

State broadcaster CCTV also issued a riposte, posting a short commentary on Weibo that called hateful sentiments “pitiful and pathetic.”

Liu Yang in Beijing and William Booth in London contributed to this report.

More on WorldViews:

How Trump’s border crisis is driven by climate change

A history of great cathedrals that have been lost to fire and war

With Notre Dame aflame, witnesses sing ‘Ave Maria’ in the streets of Paris