By Adrian Croft

BRUSSELS (Reuters) - A U.S. soldier who deserted because he thought the Iraq war was illegal could have grounds for seeking asylum in Germany but only if he can show he would have been involved in war crimes, Europe's highest court said on Thursday.

The European Court of Justice added that even if Andre Shepherd could prove war crimes were very likely to have been committed, he would still have to show he had no alternative to desertion, such as becoming a conscientious objector.

The Luxembourg-based court was asked for guidance by a German court after Shepherd took legal action when German authorities rejected his asylum application.

The final decision will be taken by the German court in accordance with the European court's ruling.

Shepherd, who served in Iraq between September 2004 and February 2005 as an Apache helicopter mechanic in the 412th Aviation Support Battalion, deserted in 2007 after being ordered to return to Iraq. He applied for asylum in Germany, where he was based. He remains in Germany.

"When I read and heard about people being ripped to shreds from machine guns or being blown to bits by the Hellfire missiles I began to feel ashamed about what I was doing," Shepherd told a news conference in Frankfurt in 2008.

"I could not in good conscience continue to serve," the army specialist from Cleveland, Ohio, said.

Shepherd believed he should no longer participate in a war he considered unlawful and in war crimes he believed were committed in Iraq. He said he risked criminal prosecution in the United States because of his desertion.

The court said the European law on refugees did cover people who feared prosecution for refusing to perform military service in a conflict where they were "highly likely" to be involved in war crimes.

However, to qualify as a refugee under the EU law, Shepherd would have to present evidence showing it was credible that war crimes would have been committed during his service in Iraq.

Story continues

Shepherd would also have to show that desertion was the only way he could have avoided participating in war crimes and that he could not have applied to be a conscientious objector, the European court said.

Failing that, the court said Shepherd was unlikely to qualify as a refugee. The prison term Shepherd might receive in the United States for desertion did not seem to amount to the persecution that would make him eligible for refugee status.

(Reporting by Adrian Croft Editing by Jeremy Gaunt)