Protest at JFK Airport on Jan. 28 against Donald Trump's executive order banning citizens of seven countries from traveling to the U.S. Rhododendrites via Wikimedia Commons

People denied entry to the United States under President Donald Trump’s first executive order restricting travel from predominantly Muslim countries have agreed to drop their suit against the government if it informs anyone who has not returned that they can reapply for their visas.

The settlement was reached as attorneys from the American Civil Liberties Union and other groups representing those affected by both travel bans prepare to clash with government attorneys before the U.S. Supreme Court for oral arguments over a revised travel ban released in March.

Arguments on the revised travel ban are scheduled for Oct. 10.

The settlement agreement on the initial travel ban, issued Jan. 27, was presented Thursday afternoon to U.S. Magistrate Judge Lois Bloom of the Eastern District of New York, with the attorneys appearing via speakerphone.

Eastern District Judge Carol Bagley Amon presided over the case.

Eastern District Judge Ann Donnelly granted an emergency injunction to halt the first ban the day after it was issued, throwing up the first of many legal roadblocks for the White House.

By that point, Customs and Border Patrol agents at John F. Kennedy International Airport were already detaining travelers as they tried to re-enter the country.

Among them were two Iraqi men, Hameed Khalid Darweesh and Haider Sameer Abdulkhaleq Alshawi, who were the plaintiffs in the suit, Darweesh v. Trump, 17-cv-480.

In a statement, Lee Gelernt of the ACLU, lead counsel for the plaintiffs, called the settlement a “complete victory” and said it closes one chapter of its fight with the White House over its efforts to restrict travel into the country.

“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,” Gelernt said.

In additional to Gelernt, the plaintiffs’ legal team included Muneer Ahmad, Elora Mukherjee and Michael Wishnie of the Jerome N. Frank Legal Services Organization at Yale Law School; Rebecca Heller of the International Refugee Assistance Project at the Urban Justice Center; and Justin Cox, Nicholas Espiritu, Melissa Keaney, Esther Sung and Karen Tumlin of the National Immigration Law Center.

Appearing for the government were U.S. Department of Justice attorneys Samuel Go, Steven Platt, Joshua Press and Gisela Westwater.

“Although this case has been moot since March, when the president rescinded the original executive order and issued a new one that does not restrict the entry of Iraqi nationals, the U.S. government has elected to settle this case on favorable terms,” said DOJ spokeswoman Nicole Navas Oxman in an email.

According to the terms of the settlement agreement, which the parties worked on for several months, the Department of Justice will designate a liaison to work with the plaintiffs to identify anyone denied entry into the country by virtue of the first order and to work with government agencies to process their applications for new visas.

Both sides agreed to bear their own fees and costs.

In litigation regarding the revised travel ban released in March—which restricted entry for people from Iran, Libya, Somalia, Syria, Sudan and Yemen for 90 days and suspended the U.S. refugee program for 120 days—the Supreme Court ruled in June that the travel ban can take effect, but narrowed its scope to apply to foreign nationals who lack a “credible claim of a bona fide relationship with a person or entity in the United States.”

On Monday, a panel from the U.S. Court of Appeals for the Ninth Circuit heard arguments over whether or not the travel ban applies to grandparents and other relatives.