WASHINGTON — The Senate failed Thursday to pass legislation to protect the U.S. electrical grid, water supplies and other critical industries from cyberattack and electronic espionage despite dire warnings from top national security officials about the potential for devastating assaults on American computer networks.

WASHINGTON — The Senate failed Thursday to pass legislation to protect the U.S. electrical grid, water supplies and other critical industries from cyberattack and electronic espionage despite dire warnings from top national security officials about the potential for devastating assaults on American computer networks.

Both Republicans and Democrats said they are committed to approving a final bill when they return in September from a monthlong recess. But deep divisions between the two parties over the right approach to cybersecurity will make it difficult to forge a compromise.

The White House and Senate Democrats blamed Republicans for blocking what they called the only comprehensive piece of cybersecurity legislation that would have given the federal government and businesses the tools they need to deal with vulnerabilities in the nation's critical infrastructure systems. More than 80 percent of U.S. critical infrastructure is owned and operated by the private sector.

"The politics of obstructionism, driven by special interest groups seeking to avoid accountability, prevented Congress from passing legislation to better protect our nation from potentially catastrophic cyber-attacks," White House Press Secretary Jay Carney said in a statement.

But Republicans argued the bill would have led to regulations imposed by Washington that would only increase the private sector's costs without substantially reducing its risks. They also said Democrats who control the Senate tried to ram the bill through without adequate time for debate.