Facing intense criticism for a lackluster relief effort in Puerto Rico, President Donald Trump reversed an earlier decision and suspended a nearly century-old maritime law Thursday to speed badly-needed aid to the U.S. territory and avoid a growing humanitarian crisis following Hurricane Maria.

Press Secretary Sarah Huckabee Sanders tweeted the president's decision to temporarily waive the Jones Act, which "will go into effect immediately."

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

Officially known as the Merchant Marine Act of 1920, the law mandates that shipping between U.S. ports and its territories, such as Puerto Rico and Guam, must be done only by U.S.-owned, U.S.-flagged and U.S.-built ships operated by American citizens. It was established to promote the U.S. maritime industry and to establish a mechanism to control ports in the event of an international war.

Waiving the act would accelerate distribution of food, medicine, clothing, building supplies and power-plant fuel for the desperate American territory, which was devastated by Hurricane Maria. On Monday eight senators sent a letter to Elaine Duke, the acting head of the Department of Homeland Security, arguing that the situation in Puerto Rico is so dire the law should be lifted.

Photos: Puerto Rico in Ruins View All 17 Images

Although the government suspended the law after Hurricanes Harvey and Irma devastated parts of Florida and Texas, Trump on Wednesday said he wasn't inclined to repeat the move for Puerto Rico. Trump told reporters that his administration was thinking about lifting the law, but added that a "lot of shippers" wanted it kept in place.

Sen. John McCain, a longtime critic of the Jones Act, also sent Duke a letter Tuesday, calling on the department to waive the act as the law "blocks the communities of Southeast Texas, South Florida, Puerto Rico, as well as the entire nation from rapid recovery," and these "emergency waivers have been valuable to speed up recovery efforts in the impacted regions."

"It is unacceptable to force the people of Puerto Rico to pay at least twice as much for food, clean drinking water, supplies and infrastructure due to Jones Act requirements as they work to recover from this disaster,” McCain wrote.