Updated

An Iraqi man who was detained in Poland last summer on terrorism suspicions was freed from prison on Monday but was immediately taken into custody by border guards, meaning his deportation is likely, according to his lawyer.

Sinan Al-Haboubi, a 48-year-old Iraqi national who had asylum in Switzerland, was arrested last July for possessing trace amounts of explosives, found on the outside of his luggage. The arrest came ahead of a visit to Poland by Pope Francis amid heightened security concerns.

Al-Haboubi's lawyer and family say that he was in Poland because he was considering opening a pizzeria and was traveling the country to scope out good locations for the business. They said he had no extremist ties and is the victim of a misunderstanding.

He was arrested on July 21 in Lodz, a city in the central part of the country, about 200 kilometers (120 miles) from Krakow, where Pope Francis arrived six days later.

Lawyer Lukasz Banatkiewicz said Al-Haboubi was freed Monday without being charged, but that border guards immediately detained him. He said he had no contact with his client.

It was not clear where Al-Haboubi would be sent. His lawyer said Al-Haboubi has now lost his right to asylum in Switzerland because he has been outside of that country for more than six months and would likely be unable to return there.

Iraq, the country where he was born but which his family fled in the 1970s for political reasons — his father's opposition to Saddam Hussein — seemed a likely place where Poland might send him. His close family members are scattered across the Middle East and Europe, living in Egypt, Saudi Arabia and Germany.

Ewa Bialik, a spokeswoman for prosecutors, confirmed that he was released on Monday. She said there was "no doubt" that Al-Haboubi had possessed dangerous substances but that investigators discontinued the probe due to a lack of further evidence.