The United States’ Kyle Dake battles for position with Iran’s Hassan Tahmasebi during a 2013 match at Vanderbilt Hall inside Grand Central Terminal. (JUSTIN LANE/European Pressphoto Agency)

As the U.S. courts try to sort out President Trump’s controversial travel ban, Iran has switched course and decided to allow American wrestlers to compete in a high-profile international tournament this month.

The World Cup takes place Feb. 16-17 in Kermanshah, Iran, and Friday, the country decided to bar the United States from competing, a direct response to President Trump’s executive order that temporarily banned citizens from Iran and six other Muslim-majority countries as well as refugees worldwide from entering the United States.

But on Sunday, after a U.S. district court judge temporarily blocked the president’s order two days earlier, Iranian government officials had a change of heart. Mohammad Javad Zarif, Iran’s minister of foreign affairs, shared the news on Twitter, saying: “Following the court ruling suspending #MuslimBan & the requests from Iranian Wrestling Federation & FILA, US Wrestlers’ visa will be granted.”

Officials from USA Wrestling did not immediately respond to a request to comment Sunday. They had been making plans for the trip for several months, and many of the top American wrestlers were expected to compete, including Olympic champions Kyle Snyder, of Woodbine, Md., and Jordan Burroughs.

While the Iranian government assembled a special committee last week to consider the Americans’ request, wrestling officials had been pleading the United States’ case behind the scenes. Following Iran’s initial ruling Friday, Nenad Lalovic, president of United World Wrestling, the sport’s international governing body, said officials were still working to find a solution.

“Despite the travel restrictions between their countries I’ve been encouraged this week by the cooperation and friendship of the Iranian Wrestling Federation and USA Wrestling,” he said in a statement. “As we’ve seen over the years, wrestling is a sport that unites people and nations. United World Wrestling hosts a full calendar of events every season and we’re certain to see American and Iranian wrestlers on the same mat again in the very near future.”

On Friday, after Iran had made its initial decision, U.S. District Judge James L. Robart temporarily blocked enforcement of Trump’s ban. Early Sunday, a federal appeals court denied the Trump administration’s initial bid to restore the executive order, declining to immediately intervene.