The Biden administration acted quickly after a primary gasoline pipeline was compromised by a cyberattack, realizing that the situation posed a number of political and economic risks.

The pipeline shutdown was an all-hands-on-deck situation for a young presidency dealing with a pandemic, a recession, an influx of unaccompanied children at the southern border, a troop withdrawal from Afghanistan, and high-stakes showdowns around the world that loomed with the threat of war.

The administration spent the first half of the week highlighting all of the steps it was taking to get gas back to affected areas’ service stations. It sprang into action after ransomware hackers shut down the pipeline, which supplies about 45 percent of the gas to the East Coast, on Friday. The shutdown resulted in a supply shortage and price increases, all of which the administration was preparing to address.

Then, on Wednesday, just hours before the Colonial Pipeline was restarted, President Joe Biden signaled that there were reasons to be optimistic.  “We have been in very, very close contact with Colonial Pipeline,” Biden said. “I think you’re going to hear some good news in the next 24 hours and I think we’ll be getting that under control.”

Later that day, the president issued an executive order to improve cybersecurity. The shutdown was also used by Biden’s team to argue for passage of the president’s $2.3 trillion infrastructure package.

The cyberattack, according to Transportation Secretary Pete Buttigieg, is a reminder that infrastructure is a national security issue and that investments in greater resilience are needed. “This is not a bonus, a luxury, or an option,” he told reporters at the White House on Wednesday. “This has to be central to how we secure critical infrastructure,” the administration said. The administration took a number of steps to address the gasoline shortage.

The Transportation Department was determining how many ships could transport fossil fuels to the Gulf of Mexico and the Eastern Seaboard in order to supply gasoline. Waivers were issued to extend the hours during which fuel could be transported by road. To alleviate any supply issues, the Environmental Protection Agency issued waivers on gas blends and other regulations.

According to the technology firm, 28 percent of stations in North Carolina were out of fuel. More than 16% of gas stations in Georgia, South Carolina, and Virginia were out of gas.

The unexpected supply shortage that resulted from Friday’s hack demonstrated the difficulties that can arise for a White House that must constantly respond to global events. Republican lawmakers slammed the administration for previously canceling plans to build the Keystone XL oil pipeline from Canada. Biden revoked the permit due to spill risks and concerns that burning the oil sands crude that would have flowed through the pipeline would exacerbate climate change.

“The Colonial Pipeline crisis shows that we need more American energy to fuel our economy, not less,” House Republican leader Kevin McCarthy said Tuesday on Twitter, adding that Biden had “left our energy supply more vulnerable to attacks” by blocking the Keystone XL pipeline. The cyberattack was but one of many challenges confronting the president.

Within a few days, the Biden administration has also received a disappointing monthly jobs report, a potentially concerning increase in inflation, and lethal violence in Israel. It is still attempting to vaccinate the country against the coronavirus, to send hundreds of billions of dollars in economic aid, and to pass its own comprehensive jobs and education agenda.

“You have to be prepared to juggle multiple challenges, multiple crises at the same time,” White House press secretary Jen Psaki said Wednesday.

Higher energy prices frequently have political ramifications, making reelection campaigns for incumbents outside of oil-producing regions more difficult. The 1979 fuel shortage effectively ended Jimmy Carter’s presidential reelection bid and ushered in the Reagan era.

The World Bank published a study last year that examined 207 elections in 50 democracies and discovered that an increase in oil prices a year before an election “systematically lowers the odds of incumbents being reelected.” The findings applied to both conservatives and liberals, demonstrating voter pragmatism.

Biden’s best response was probably to demonstrate that he understands how rising gas prices affect family budgets and to move quickly to help fix the pipeline problem.

“It is critical for the president to demonstrate empathy and recognize the average American’s position on gas prices “Rice University’s Mark Jones, a political science professor, agreed. “Gas prices are unimportant to the elite, and our politicians are all members of the elite.”