German soldier posed as Syrian refugee and 'planned attack'Watch
Prosecutors in Frankfurt said the 28-year-old suspect was motivated by a "xenophobic background".
A student, 22, said to be a co-conspirator, has also been arrested.
The soldier was first detained by Austrian police in February after he tried to retrieve a handgun he had hidden in a toilet at Vienna airport.
He was released but police subsequently discovered the suspect had registered as a Syrian refugee at a shelter in central Germany in December 2015 and later officially requested political asylum in Bavaria, prosecutors said.
No concerns were raised at the time, despite the man speaking no Arabic. German media report that he even received monthly payments and accommodation.
"These findings, and indications of a xenophobic background of the Bundeswehr soldier, suggest that the accused was planning a serious crime endangering state security with the weapon that was earlier deposited at Vienna airport," the prosecutors' statement said, according to AFP news agency.
The gun is reported not to have come from the German armed forces.'