SANTA ANA, Calif. — After more than four days in detention, five members of an Afghan family with special immigrant visas were released on Monday, allowing them to travel to the Washington town where they intend to settle.

The father had worked for the American government in Afghanistan for a decade and received the visas based on his work.

Federal officials said that they would meet with the family on April 5 to review their visa documents and that they would be free without “any limitation of their liberties” until then.

“This is a real victory in terms of the government acknowledging that the family does not pose a threat,” said Mark Rosenbaum, a lawyer with Public Counsel, who helped with the case. “But we should have never had to go to federal court to make this happen. This is not a way to thank someone for their service.”