The US government will allow people barred from entering the country in the early days of President Donald Trump's travel ban to reapply for visas following a legal settlement with campaigners.

Under the terms of the agreement, announced on Thursday, the government must contact all individuals who had been turned away at borders as a result of the president's first executive order that came into force on January 27 and inform them that they may seek re-entry.

It does not guarantee applicants will receive new visas nor does it award them compensation, but obliges the government to act in "good faith" when processing their paperwork.

The settlement also guarantees that those who reapply for their visas can do so with the help of the Department of Justice liaison for a three month period.

The settlement brings an end to the case Darweesh v Trump, a nationwide class-action suit filed by two Iraqi men detained at New York's JFK Airport because of the ban. They were represented by numerous rights groups including the American Civil Liberties Union (ACLU).

'Legal fight will continue'

It was the first legal challenge to the original Muslim ban and had previously succeeded in gaining an injunction on removing anyone from the United States on the basis of the ban.

"Although the government dragged its feet for far too long, it has finally agreed to do the right thing and provide those excluded under the first Muslim ban with proper notice of their right to come to the United States," Lee Gelernt, an ACLU lawyer involved in the case, said.

But the "legal fight against Muslim ban 2.0" would continue, he added, with the Supreme Court set to hold another hearing in October.

OPINION: The Muslim ban - Did Trump really win?

Gerlent said it is unclear how many people will benefit from the settlement because the government has refused to disclose the total.

The first order, which banned for three months nationals from seven Muslim-majority countries - Iran, Iraq, Libya, Syria, Somalia, Sudan and Yemen - and refugees for four months, caused chaos at airports and triggered protests across major cities.

Hundreds of nationals from the countries affected by the ban were detained on arrival despite having valid visas or even residency documents.

It was quickly challenged in court by campaigners and several US states and was suspended on February 3.

A revised version was announced in March, barring nationals from the countries mentioned in the previous ban, except Iraq. The revised order also said that visa and green card holders were exempt.

The administration scored a partial victory in June when the Supreme Court ruled that it could proceed with the ban, though people with a "bona fide relationship" to a US person or entity were exempt.