A last-minute proposed amendment to the Cyber Information Sharing and Protection Act that would have made it illegal for employers or the federal government to ask for employees' or prospective employees' Facebook passwords was defeated in the House of Representatives 224-188 along party lines, with Republicans knocking it down.

Rep. Ed Perlmutter D-Colo. said he offered the amendment due to an emerging trend of companies asking for prospective employees' social media passwords before offering them a job. He said his amendment is similar to legislation that prevents employers from requiring polygraph tests as a condition of employment.

"Let me boil [it] down: these are two direct and simple paragraphs that say as a condition of employment, you can't be made to give up a password to your Twitter, Facebook or LinkedIn accounts," Perlmutter said. "This thing has exploded. People are being asked for their private passwords to various social media networks."

Rep. Mike Rogers, R-Mich., sponsor of the CISPA bill, said Perlmutter's amendment was nothing more than an attempt to kill the law, a claim Perlmutter denied.

"This has nothing to do with our bill," Rogers said, suggesting the issue should be tackled with separate legislation.

Last year, Maryland became the first state to make it illegal for employers to ask for employees' Facebook passwords.