The U.S. government relaxed a long-standing maritime law protecting domestic shipping commerce to allow an undisclosed company to transport gasoline and diesel to ports in the East Coast after a cyberattack crippled the nation's largest fuel pipeline network.

The Jones Act, implemented in 1920, requires goods moved between U.S. ports to be carried by ships built domestically and staffed by U.S. crews. The waiver will allow foreign vessels to ship petroleum products such as gasoline and diesel to the country from the Gulf Coast to U.S. East Coast ports.

The pipeline network, owned by privately held Colonial Pipeline, was targeted by what the FBI said was a shadowy criminal group called DarkSide.

Colonial, which was forced to shut the line, triggering fuel shortages and panic buying in southeastern United States, said on Wednesday it was slowly restarting the network, while adding that it will take several days to return to normal operations.

Secretary Alejandro Mayorkas of the U.S. Department of Homeland Security did not name the company to which the temporary waiver was granted. The approval was given in the interest of national defense, he said, after consulting the Departments of Transportation, Energy and Defense.

"This waiver will help provide for the transport of oil products between the Gulf Coast and East Coast ports to ease oil supply constraints as a result of the interruptions in the operations of the Colonial Pipeline," he said.

Jones Act restrictions are waived sparingly. In 2017, the former administration of President Donald Trump waived them to help get fuel and supplies to storm-hit Puerto Rico.

Separately, White House Press Secretary Jen Psaki said in a statement that the Biden administration will stay in contact with Colonial Pipeline and offer any assistance to them as needed in the coming days.

Psaki urged people not to hoard fuel and only purchase what they need.

(Reporting by Bhargav Acharya and Aakriti Bhalla in Bengaluru; Editing by Kim Coghill, Sayantani Ghosh and Shounak Dasgupta) ((Bhargav.Acharya@thomsonreuters.com))