The couple and their three young sons were taken into custody after arriving at Los Angeles International Airport last week.
They had Special Immigrant Visas, which were granted for life-risking work done for the US military.
Afghanistan is not among the countries in President Trump's travel ban list.
The family had travelled to LA for a connecting flight to Washington, where they planned to resettle.
The father, who has not been named, worked for the US government in Afghanistan.
He was taken to a maximum-security detention facility in Orange County, California, according to Becca Heller, the director of the International Refugee Assistance Project.
His wife and children, aged seven years, six years and eight months, were reportedly taken to a similar facility but later moved to a hotel.
A petition for the release of the Afghan family was filed by the International Refugee Assistance Project, which said they had been taken into custody "with absolutely no justification" and it was a violation of due process rights under the US constitution.
Over the weekend, a federal judge issued a temporary order blocking authorities from removing the family from California.
Talia Inlender, one of their lawyers, said immigration authorities had agreed to release them from custody on Monday.
Earlier, she said it was "extremely unusual if not entirely unique" for someone with a Special Immigrant Visa to be detained upon arrival.
The family will be allowed to remain in the US subject to an immigration review at a later date.
The news emerged on the same day as Donald Trump's re-worked travel ban was announced.
The president has signed a new executive order placing a 90-day ban on people from six mainly Muslim nations.
Iraq - which was included in the previous seven-nation order - has been removed from the new one after agreeing to additional visa vetting measures.
The directive, which includes a 120-day ban on all refugees, takes effect on 16 March.
Members of an Afghan family who were detained in the US despite having valid entry visas will be released on Monday, their lawyer has said.