JERUSALEM -- A handwritten letter written by Albert Einstein warning of the dangers of growing nationalism and anti-Semitism years before the Nazis rose to power has been sold for nearly $40,000. The Kedem Auction House says the previously unknown letter, brought forward by an anonymous collector, fetched $39,360 in bidding in Jerusalem on Tuesday night.

Einstein wrote the letter to his sister after going into hiding in 1922 following the assassination of Germany's Jewish foreign minister by right-wing extremists. Police had warned the Jewish scientist that his life could be in danger too.

"Here are brewing economically and politically dark times, so I'm happy to be able to get away from everything," he wrote.

Get Breaking News Delivered to Your Inbox

Kedem says the letter was sold at roughly double its expected price.

The discovery and sale of the letter comes as governments in Europe grapple with a new rise of nationalistic and far-right sentiment -- one which U.S. President Donald Trump appears to embrace.

At a commemoration ceremony on Sunday in Paris, marking 100 years since the end of the first World War, French President Emmanuel Macron took on the rising tide of populism in the United States and Europe and urged leaders not to turn their backs by turning inward.

"Patriotism is the exact opposite of nationalism: Nationalism is a betrayal of patriotism," Macron said, six days after President Trump declared himself a "nationalist" and with the U.S. leader watching him give his address.

Macron said that when nations put their interests first and decide, "who cares about the others," they "erase the most precious thing a nation can have ... its moral values."