A German soldier found posing as a Syrian refugee has been arrested for allegedly planning a “false flag” shooting attack that would be blamed on asylum seekers.

The unidentified soldier was detained when he went to retrieve a loaded pistol he had hidden in a bathroom at Vienna International Airport.

The public prosecutor’s office in Frankfurt said the 28-year-old is suspected of planning a serious “state-threatening act of violence”, fraud and violating firearms laws.

More than 90 German police officers have worked alongside Austrian and French security forces to search 16 locations across three countries on Wednesday, when a suspected accomplice was arrested in Bavaria.

The suspect was stationed at Illkirch-Graffenstaden, eastern France. (AFP/Getty Images) (AFP)

Investigations have revealed that the Bundeswehr lieutenant was stationed at Illkirch-Graffenstaden in France before registering as a refugee back in Germany.

He gave false information to authorities in Giessen, Hesse, on 30 December 2015 – as Germany was overwhelmed by the arrival of almost a million asylum seekers.

Posing as a Syrian refugee but reportedly speaking in French, rather than Arabic, the man submitted an asylum application at Zirndorf in Bavaria in January last year.

“As a result, he was given shelter in a refugee home and has received monthly financial benefits under this false identity,” the Frankfurt prosecutor’s office said.

“These findings, as well as other evidence, point towards a xenophobic motive for the soldier’s suspected plan to commit an attack using a weapon deposited at Vienna airport.”

If his plan had succeeded, his fingerprints would have registered on the refugee records system and led investigators to his false identity as a Syrian asylum seeker, turning fresh scrutiny on migrants in Germany.

Refugees settle in Germany Show all 12 1 /12 Refugees settle in Germany Refugees settle in Germany Germany Mohamed Zayat, a refugee from Syria, plays with his daughter Ranim, who is nearly 3, in the one room they and Mohamed's wife Laloosh call home at an asylum-seekers' shelter in Vossberg village on October 9, 2015 in Letschin, Germany. The Zayats arrived approximately two months ago after trekking through Turkey, Greece and the Balkans and are now waiting for local authorities to process their asylum application, after which they will be allowed to live independently and settle elsewhere in Germany. Approximately 60 asylum-seekers, mostly from Syria, Chechnya and Somalia, live at the Vossberg shelter, which is run by the Arbeiter-Samariter Bund (ASB) charity 2015 Getty Images Refugees settle in Germany Germany A refugee child Amnat Musayeva points to a star with her photo and name that decorates the door to her classroom as teacher Martina Fischer looks on at the local kindergarten Amnat and her siblings attend on October 9, 2015 in Letschin, Germany. The children live with their family at an asylum-seekers' shelter in nearby Vossberg village and are waiting for local authorities to process their asylum applications. Approximately 60 asylum-seekers, mostly from Syria, Chechnya and Somalia, live at the Vossberg shelter, which is run by the Arbeiter-Samariter Bund (ASB) charity Getty Images Refugees settle in Germany Germany Kurdish Syrian asylum-applicant Mohamed Ali Hussein (R), 19, and fellow applicant Autur, from Latvia, load benches onto a truckbed while performing community service, for which they receive a small allowance, in Wilhelmsaue village on October 9, 2015 near Letschin, Germany. Mohamed and Autur live at an asylum-applicants' shelter in nearby Vossberg village. Approximately 60 asylum-seekers, mostly from Syria, Chechnya and Somalia, live at the Vossberg shelter, which is run by the Arbeiter-Samariter Bund (ASB) charity Getty Images Refugees settle in Germany Germany Mohamed Ali Hussein ((L), 19, and his cousin Sinjar Hussein, 34, sweep leaves at a cemetery in Gieshof village, for which they receive a small allowance, near Letschin Getty Images Refugees settle in Germany Germany Mohamed Zayat, a refugee from Syria, looks among donated clothing in the basement of the asylum-seekers' shelter that is home to Mohamed, his wife Laloosh and their daughter Ranim as residents' laundry dries behind in Vossberg village on October 9, 2015 in Letschin, Germany. The Zayats arrived approximately two months ago after trekking through Turkey, Greece and the Balkans and are now waiting for local authorities to process their asylum application, after which they will be allowed to live independently and settle elsewhere in Germany Getty Images Refugees settle in Germany Germany Asya Sugaipova (L), Mohza Mukayeva and Khadra Zhukova prepare food in the communal kitchen at the asylum-seekers' shelter that is their home in Vossberg village in Letschin Getty Images Refugees settle in Germany Germany Efrah Abdullahi Ahmed looks down from the communal kitchen window at her daughter Sumaya, 10, who had just returned from school, at the asylum-seekers' shelter that is their home in Vossberg Getty Images Refugees settle in Germany Germany Asylum-applicants, including Syrians Mohamed Ali Hussein (C-R, in black jacket) and Fadi Almasalmeh (C), return from grocery shopping with other refugees to the asylum-applicants' shelter that is their home in Vossberg village in Letschin Getty Images Refugees settle in Germany Germany Mohamed Zayat (2nd from L), a refugee from Syria, smokes a cigarette after shopping for groceries with his daughter Ranim, who is nearly 3, and fellow-Syrian refugees Mohamed Ali Hussein (C) and Fadi Almasalmeh (L) at a local supermarket on October 9, 2015 in Letschin, Germany. All of them live at an asylum-seekers' shelter in nearby Vossberg village and are waiting for local authorities to process their asylum applications, after which they will be allowed to live independently and settle elsewhere in Germany 2015 Getty Images Refugees settle in Germany Germany Kurdish Syrian refugees Leila, 9, carries her sister Avin, 1, in the backyard at the asylum-seekers' shelter that is home to them and their family in Vossberg village in Letschin Getty Images Refugees settle in Germany Germany Somali refugees and husband and wife Said Ahmed Gure (R) and Ayaan Gure pose with their infant son Muzammili, who was born in Germany, in the room they share at an asylum-seekers' shelter in Vossberg village on October 9, 2015 in Letschin, Germany. Approximately 60 asylum-seekers, mostly from Syria, Chechnya and Somalia, live at the Vossberg shelter, which is run by the Arbeiter-Samariter Bund (ASB) charity, and are waiting for authorities to process their application for asylum 2015 Getty Images Refugees settle in Germany Germany German Chancellor Angela Merkel pauses for a selfie with a refugee after she visited the AWO Refugium Askanierring shelter for refugees in Berlin Getty Images

Isis has previously used a similar ploy, giving its militants fake Syrian passports that were found at the scene of the Paris attacks.

The man’s suspected accomplice, a 24-year-old student, was arrested in Hammelburg for alleged involvement in the plot.

Police have searched the homes of the two suspects as well as their friends and workplaces, with detectives seizing “extensive material” including mobile phones, laptops and documents.

Prosecutors said the soldier had no permission for the 7.65mm pistol stashed in Vienna, while illegal weapons were also found at his accomplice’s house.

Both men remain in custody in Frankfurt as the probe continues.

The soldier was arrested days after prosecutors revealed that the man who orchestrated the Dortmund bus bombings had attempted to frame Isis to make money on shares.

Police chief says Germany 'on high alert' after attack

Sergej W, a dual German-Russian national, detonated three bombs targeting a bus carrying the Borussia Dortmund football team, seriously injuring one player on 11 April.

He left misspelled letters at the scene claiming the attack was retaliation for German military intervention against Isis, but investigations found he was not an Islamist but a trader planning to profit from short-selling shares.

A series of Isis-inspired terror attacks and plots in Germany have raised tensions leading into September’s federal elections, where Angela Merkel is battling to win a fourth term as Chancellor.

Right-wing groups have blamed her decision to open borders to refugees in 2015, while extremists have launched hundreds of attacks on asylum seekers’ accommodation.

At least two neo-Nazi terror plots have been uncovered, while security services have cracked down on the anti-government Reichsbürger movement after one of its members killed a police officer.