The U.S. House of Representatives passed a bill on Wednesday that would make it easier for private companies to share information about cybersecurity threats with the government without fear of lawsuits.

The vote was 307-116 in favor of the measure, with strong support from Republicans and Democrats.

Several previous bills addressing the issue had failed, partly because of concerns that they might lead to more surveillance. But a series of high-profile cyber attacks on Sony Pictures Entertainment, Target and other U.S. corporations added urgency to the push for legislation.

“At some point, we need to stop talking about the next Sony, the next Anthem, the next Target, the next JP Morgan Chase and the next State Department hack, and actually pass a bill that will help ensure that there will be no next cyber attack,” said Representative Adam Schiff, the top Democrat on the House Intelligence Committee.

Corporations have been clamoring for Congress to act. The U.S. Chamber of Commerce sent a letter to every member of the House earlier on Wednesday urging support of the bill.

The legislation must be approved by the Senate before it can be sent to President Barack Obama to sign into law. A similar measure passed by a 14-1 vote in the Senate Intelligence Committee, and supporters say they expect strong bipartisan support in the full Senate as well.

The Obama administration said on Tuesday it had some concerns about the bill but supported its passage and believed it could be fixed as the legislation is finalized in Congress.