Richard B. Spencer, the controversial white nationalist activist known for coining the term “alt-right,” voiced regret for supporting President Trump in the 2016 election Tuesday.

Mr. Spencer, who championed Mr. Trump during his first presidential campaign and was famously assaulted on Inauguration Day 2017, waxed remorseful on social media amid escalating tensions between the U.S. and Iran resulting in both countries recently nearing the brink of war.

“I deeply regret voting for and promoting Donald Trump in 2016,” Mr. Spencer wrote from his Twitter account.

In a subsequent social media posting addressed to the “people of Iran,” Mr. Spencer tweeted that there are “millions of Americans who do not want war, who do not hate you, and who respect your nation and its history,” adding: “After our traitorous elite is brought to justice, we hope to achieve peace, reconciliation, and forgiveness.”

He also tweaked his Twitter profile so that an image of the Iranian flag is displayed for now in tweets sent from his account.

Mr. Spencer, the head of the National Policy Institute, a white nationalist think-tank, previously achieved mainstream notoriety upon lauding Mr. Trump using Nazi rhetoric.

“Hail Trump, hail our people, hail victory!” Mr. Spencer said during the group’s annual conference shortly after the president was elected in November 2016.

Mr. Spencer was attending festivities surrounding Mr. Trump’s inauguration weeks later when cameras caught him being punched in the head by a protester. Footage of the assault quickly went viral.

More recently, Mr. Spencer called Mr. Trump “wicked and disgusting” last week after the latter threatened to attack Iranian cultural sites as tensioned worsened between Washington and Tehran.

An attorney representing Mr. Spencer in court cases has previously described the alt-right as “a Eurocentric political ideology which advocates the preservation of national identity, a return to traditional Western values and advances European racial interests.”

Mr. Spencer said in 2018 that he has been banned from visiting 26 countries in Europe encompassing the continent’s visa-free Schengen area. He has also been banned from the University of Virginia in Charlottesville, his alma mater, over his role in leading a torchlit march held on the eve of the deadly “Unite the Right” rally in 2017, where he had been scheduled to speak prior to the event descending into chaos.