An appeals court in Sweden overturned a deportation order against a Palestinian man who firebombed a synagogue, saying he would be under possible threat from Israel because of his crime if sent to the Palestinian Authority.

The ruling Wednesday by the Court of Appeals for Western Sweden was on a motion filed by one of the three men convicted in June of the attempted arson in December of a synagogue in Gothenburg, hours after a march in the southern city against the U.S. recognition of Jerusalem as Israel’s capital.

>> Caught between jihadists and neo-Nazis, Swedish Jews fear for their future

The appellant, who was not named in the Swedish media, was sentenced to two years in prison and ordered to be deported after serving that term. The court upheld the conviction while overturning the deportation order, citing Israel as the reason, the SVT broadcaster reported.

Since the man committed a crime that “could be perceived as a threat to other Jews,” and that Israel “might be interested in the matter,” the appeals court ruled that one “cannot safeguard the man’s fundamental human rights if he is deported to Palestine,” the broadcaster quoted the judge as writing in his opinion.

Israel's Foreign Ministry spokesman Emmanuel Nahshon slammed Sweedish Ambassador Ilan Ben Dov, calling the court statement "shameful." Nahshon tweeted, "The Swedish court gives legitimacy to violent anti-Semitism and defames the State of Israel."

Credit: Twitter

The three Arabs who were convicted of trying to torch the synagogue were part of a group of more than a dozen men who hurled firebombs at the building. Teens from the local Jewish community were attending a party inside the synagogue complex at the time.

The other two assailants had Swedish residency permits, according to The Associated Press. The Palestinian man was on a visa for asylum seekers.

The attack, which was classified as a hate crime, was caught on surveillance cameras, according to Aftonbladet. There was minor damage to the building.

Following the attack, the Jewish teens waited for police and their parents in the synagogue basement for safety reasons.