WASHINGTON — As long lines persisted at gas stations in the New York metropolitan area, federal authorities moved on Friday to restore supplies, instructing the Defense Department to send 24 million gallons of fuel to the region and lifting restrictions on deliveries by foreign-flagged ships.

With the reopening of the Port of New York to tankers on Thursday, and the return of a critical Northeast fuel pipeline to full capacity on Friday, the biggest outstanding problems are the lack of power at hundreds of gas stations and continued panic buying by the public, industry officials said.

Because electricity will not be restored in parts of central New Jersey for seven to 10 days, gasoline shortages may remain severe in some areas. As of Friday, according to AAA, only 40 to 50 percent of the gas stations in New York City and New Jersey were operating, and even fewer were operating on Long Island. Most of the stations were out of service because of power failures.

“We have seen some stations open as power is restored, but other stations have closed while running out of gas,” said Michael Green, an AAA spokesman. “The long lines and supply problems will go away once power is restored.”