BERLIN — A German Army lieutenant appears to have taken advantage of his country’s chaotic system of processing migrants in 2015 to pose as a Syrian asylum seeker with the intention of carrying out an attack, the authorities said on Thursday.

Prosecutors said the soldier, whose name was not released, was a 28-year-old German from the city of Offenbach, near Frankfurt, who was stationed with the army at the Illkirch base in France, near the German border.

He is suspected of planning a violent attack, weapons violations and fraud, prosecutors in Frankfurt said. They were not aware of any specific targets, said Nadja Niesen, a spokeswoman for the prosecutors.

The man first caught the attention of Austrian authorities in January, when he stashed a loaded pistol in a cleaning shaft in a restroom at Vienna International Airport. He was detained on Feb. 3 when he returned for the weapon, prosecutors said.