One of the recurring nightmare scenarios outlined by security experts—a cyberattack on the country's power grid—has inspired lawmakers in both parties to come to rare agreement. A bipartisan energy bill pending in the Senate would give the U.S. energy secretary emergency powers in the event of such an attack and provide for research into digital energy security.

"The Energy Policy Modernization Act is designed to defend our national energy grid from terrorist cyberattacks," Senate Majority Leader Mitch McConnell, R-Ky., told Senate colleagues Tuesday. "It would help prepare us by authorizing additional cybersecurity research, it would help deter attacks by erecting stronger cybersecurity defenses, and it would help provide for faster and more effective responses when threats do arise.

The bill would allow the president to grant the energy secretary emergency authority in the event of a cyberattack on the electric grid, allowing the secretary to order power companies "to take such actions as the Secretary determines will best avert or mitigate the cybersecurity threat."

It would also authorize $100 million in annual funding through 2025 for research into energy grid security.

The proposed law, which The Hillreports is likely to pass the Senate as soon as Thursday, comes as officials have expressed increased concern about cybersecurity threats to the power grid. Officials have said networks tied to the power sector are regularly probed by hackers, including some apparently tied to foreign countries.

The Defense Advanced Research Projects Agency (DARPA) announced in December a program to fund research into efforts to restore power after a major digital attack on the grid. The program, called Rapid Attack Detection, Isolation and Characterization Systems, or RADICS, aims to develop systems to let power companies to restore service within seven days, even after a serious attack.

"If a well-coordinated cyberattack on the nation’s power grid were to occur today, the time it would take to restore power would pose daunting national security challenges," said John Everett, DARPA program manager, in a statement at the time.

No power outages in the United States have been tied to hacking attempts. A power outage in Ukraine in December was reportedly the first one to be tied to such an attack.

Never miss a story.

Sign up for the Fast Company newsletter and get the best stories delivered to your inbox daily.