Updated

The lawyer who represented the now-free U.S. hikers held for two years in Iran on espionage and illegal entry charges was barred from leaving the country Sunday, according to a source close to the case.

"This [Sunday] morning at around six o'clock [local time], after getting his passport stamped and as he was boarding the plane, his passport was confiscated by order of the judiciary," the source said on condition of anonymity.

The source added that Masoud Shafii "could not proceed to his final destination, which was the United States," without elaborating on why his passport was seized.

On Tuesday, he was arrested at his home and questioned for several hours by judiciary officials before being released, the source said, adding that agents confiscated documents, his computer and his passport but returned them later.

Shafii represented Shane Bauer, Josh Fattal and Sarah Shourd in a case that lasted for more than two years. He always maintained that his clients were innocent and was criticized by conservative hard-liners in the Islamic Republic.

Shafii also criticized the judiciary for not allowing him proper access to the three, as required by the law. He met them briefly only three times in two years -- once before the start of their trial and once before each of two hearings in February and August.

Bauer, Fattal and Shourd were charged with illegal entry and spying on Iran after they were arrested in July 2009 along the country's unmarked border with Iraq.

Shourd was released on bail in September 2010 on health grounds, and her two companions were freed on bail on Sept. 21 after being sentenced in August to eight years in prison each by a Tehran revolutionary court.

Four days later, Fattal and Bauer accused Iran at a New York news conference of using them as hostages in its power struggle with the West and described hearing the anguished cries of fellow inmates being beaten in Tehran's Evin prison.

Iran's judiciary promptly denied their charges.

The case angered Washington, already mired in deep differences with Tehran over its nuclear program, its refusal to recognize Israel and its support for militant groups in the Middle East.