The vote was 307-116 in favour of the "Protecting Cyber Networks Act." There were 202 votes in favour from Republicans and 105 from Democrats.
Several previous bills addressing the issue had failed, partly because of concerns that they might lead to more of the surveillance exposed two years ago by former National Security Agency contractor Edward Snowden.
But a series of high-profile cyber-attacks on Sony Pictures Entertainment, Target and other US 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 US 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 when it considers the bill later this spring.
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 finalised in Congress.
Privacy advocates blasted the legislation.
"These bills do little to protect the Internet, but rather reward companies who undermine the privacy of their customers," said Nathan White, senior legislative manager at the advocacy group Access Now, in a statement.
The House is due to debate a second cyber-security bill, the National Cybersecurity Protection Advancement Act of 2015, on Thursday. That bill would use the US Department of Homeland Security as an intermediary for sharing the electronic information.
© Thomson Reuters 2015
For the latest tech news and reviews, follow Gadgets 360 on X, Facebook, WhatsApp, Threads and Google News. For the latest videos on gadgets and tech, subscribe to our YouTube channel. If you want to know everything about top influencers, follow our in-house Who'sThat360 on Instagram and YouTube.