President Trump waived shipping restrictions for Puerto Rico based on a request from Gov. Ricardo Rossello and after an outcry from Congress about shortages of fuel, food and emergency supplies on the island after Hurricane Maria.

Rossello quickly thanked Trump for the assistance.

The Jones Act prohibits foreign-flagged vessels from picking up and delivering fuel between U.S. ports. But government officials said it wasn’t clear immediately there was justification to waive the law for national defense.

The island was battered by repeated hurricanes, most severely by Maria, and residents faced shortages of all supplies. Lawmakers including Sen. John McCain, R-Ariz., and Rep. Nydia Velazquez, D-N.Y., urged the Trump administration to waive the Jones Act to allow more supplies to reach the island.

The administration waived the act for Southeastern states from Sept. 8 through 22, after Hurricanes Harvey and Irma. But Defense and Homeland Security officials said there were plenty of ships to supply Puerto Rico — the problem was moving supplies around the island because of roads blocked by trees and landslides.

Trump, who plans to visit the island Tuesday, said Wednesday that he was studying the matter, but that the U.S. shipping industry was opposed to waiving the law.

Sarah Sanders, Trump’s spokeswoman, tweeted Thursday that the Jones Act would be waived.

“It will go into effect immediately,” Sanders said.