The festive Christmas market in the western part of Berlin was teeming with holiday shoppers when a truck plowed into the crowd, killing at least 12 people and injuring as many as 50. And with that horror, the world was reminded anew of the dangers of our times, and the challenges that lie ahead.

Monday’s apparent attack, which is being investigated by German police as an act of terrorism, came just hours after the assassination of the Russian ambassador to Turkey. The gunman, identified as a Turkish police officer, yelled, “Don’t forget Aleppo, don’t forget Syria,” after he shot Andrei G. Karlov in the back. The reference was to the northern Syrian city devastated by civil war, a war that found Russia and Turkey on opposing sides.

There is a lot we don’t yet understand about these incidents. Much of what has happened is a result of conflicts with roots that are both ancient and modern, secular and religious.

Germany, which has been the European country most welcoming of refugees from strife in the Middle East and elsewhere, has seen a string of terrorist attacks this year and a rise of nationalism. Turkey, which harbors nearly 3 million Syrian refugees, has become increasingly destabilized with an attempted coup and President Recip Teyyip Erdogan ordering mass arrests of alleged opponents and journalists.

This is the world that will be inherited by Donald Trump, whose election as the nation’s 45th president was made official Monday by the Electoral College. He will be sworn into office in 31 days.

This would be a complex time for any president-elect, even someone with years of experience on the international stage. But it is much more difficult when you are at odds with the nation’s intelligence community, most recently over its apparent findings that Russia interfered in the election to sway it to Trump. It also is a compelling reminder of the importance of receiving intelligence briefings every day. Knowledge informs decisions, and Trump likely will be pressed to make important ones soon after moving into the Oval Office.

Trump’s response to the incident in Berlin was to issue a statement expressing sympathy for the victims and their families while pledging to eradicate terrorist networks worldwide in partnership with other “freedom-loving” countries. That was more appropriate than last week’s tweet saying we should tell China to keep an unmanned underwater research drone that nation’s navy had seized rather than return it.

While we still don’t know many facts about Monday’s violence, it is important to understand the attacks in the context of traditions and institutions. Christmas markets date to the Middle Ages in Germany and Austria. They are a symbol of Christianity in Western Europe, and are every bit as significant and culturally resonant as institutions Americans revere in this country, and therefore a potential target of terrorism. And the Turkish assassin was a police officer, the very symbol of safety and security, sowing disorder and terror.

And so, as Christmas approaches, joy to the world becomes sorrow among all humanity.— The editorial board