The German government says it is “leaving no stone unturned” in a probe into how a soldier falsely registered as a Syrian refugee for an alleged terror plot.

Franco A led a double life for more than a year, remaining in his post as a Bundeswehr lieutenant while receiving state benefits under a fabricated identity as a supposed asylum seeker.

Joachim Herrmann, the Bavarian interior minister, said the astonishing case provided “grim proof” that migrants had been registered in Germany “without proper examination of their identity”.

“Investigators must clearly and carefully examine how a Bundeswehr soldier could have his application as a Syrian asylum seeker recognised,” he added.

The German interior ministry said every effort would be made to discover how the migration ministry was duped, admitting that Franco A’s application came at a time of “particular strain”.

“On the basis of an interview he was offered subsidiary protection – that decision was wrong,” a spokesperson said.

“The [relevant ministries] will leave no stone unturned until we know how this happened and, if there are shortcomings, put a stop to them.”

Police chief says Germany 'on high alert' after attack

The interior ministry said it had imposed enhanced security on asylum applicants, taking every person’s fingerprints – which are cross-referenced with criminal databases - while carrying out individual interviews.

A spokesperson claimed that “structural flaws” were not the problem, blaming the case on staff failing to follow protocol and insisting there was no reason for “needless review of all asylum seekers”.

The probe was triggered after Franco A stashed an unregistered 7.65mm pistol in a toilet at Vienna International Airport while attending a military ball there in January.

Austrian police detained him when he attempted to retrieve the loaded gun on 3 February, running fingerprints that revealed his identity as a refugee in Germany – triggering the investigation that would expose the extraordinary plot.

Franco A created a fake persona under the name David Benjamin, telling immigration officials he was from a Christian family with French roots, German media reported.

A German soldier holds a machine gun MG4 during the 'Land Operations' military exercises during a media day at the Bundeswehr training grounds on October 14, 2016 near Bergen, Germany. The exercises are taking place from October 4-14. (Getty Images)

No doubts appear to have been raised over the credibility of the 28-year-old’s claimed background, despite him speaking mainly French with a smattering of Arabic from a language course.

Franco A registered in Giessen, Hesse, on 30 December 2015 – as Germany was overwhelmed by the arrival of almost a million asylum seekers - then 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.”

Officials did not give any further details but Die Welt reported Franco A had repeatedly attacked Arab asylum seekers and Muslims in an online chat.

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.

But it fell apart when Franco A failed to answer a court summons in Austria, sparking a wider investigation into “David Benjamin” that swiftly exposed the artifice.

According to Der Spiegel, the suspect was regarded as “cosmopolitan and popular” among his friends and was an enthusiastic pupil who once dreamed of becoming a journalist, before studying at the prestigious Saint-Cyr French military academy.

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

The German ministry of defence said Franco A had been in the army for eight years and was stationed at Illkirch-Graffenstaden in France, where he did not raise an alert over right-wing extremism.

He appeared at the barracks on time and completed all courses even while dashing back to Bavaria to pick up monthly welfare payments.

Franco A was still serving when he was finally arrested, being pulled out of a hole in the ground by police during a training exercise in Hammelburg on Wednesday.

His suspected accomplice, a 24-year-old student, was arrested for alleged involvement in the plot.

He and Franco A both come from Offenbach, near Frankfurt, and allegedly shared anti-migrant news articles and text messages.

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.