The White House on Thursday waived an act that was preventing foreign ships from delivering supplies to Puerto Rico, more than a week after Hurricane Maria devastated the US territory.

The White House press secretary, Sarah Huckabee Sanders, said in a tweet that Donald Trump had authorized the Jones Act to be waived for Puerto Rico at the request of its governor, Ricardo Rosselló. “It will go into effect immediately,” she said.

At @ricardorossello request, @POTUS has authorized the Jones Act be waived for Puerto Rico. It will go into effect immediately. — Sarah Sanders (@PressSec) September 28, 2017

The Jones Act requires goods sent between US ports to be carried on ships built, owned and operated by the US.

But lawmakers said it slowed the delivery of much-needed aid to Puerto Rico, where millions of Americans do not have electricity, adequate access to clean drinking water or a reliable fuel supply.

The law was suspended in the wake of Hurricanes Harvey and Irma to help ships reach Florida and Texas, but the president expressed reluctance to do the same for Puerto Rico.

“We’re thinking about that,” Trump said on Wednesday. “But we have a lot of shippers and a lot of people that work in the shipping industry that don’t want the Jones Act lifted, and we have a lot of ships out there right now.”

The situation in Puerto Rico is dire – few of the hospitals are functioning and about 44% of residents are without clean drinking water, according to the US Department of Defense. There are food shortages and some isolated parts of the territory are still without functioning telecommunications systems. Cash is also running low on the island, where only a few banks are open and lines to withdraw money stretch for hours.

Lawmakers, including Senator John McCain of Arizona, had pushed the government to waive the Act.

McCain sent a letter to the acting secretary of the Department of Homeland Security, Elaine Duke, on Tuesday arguing the Jones Act should be suspended for good. “Now, more than ever, it is time to realize the devastating effect of this policy and implement a full repeal of this archaic and burdensome Act,” he said.