The House of Representatives on Friday voted overwhelmingly in favor of a "compromise" spy law that would shield AT&T and other companies from pending lawsuits accusing them of opening their networks to the government in violation of wiretap laws.

The major sticking point in the contentious rewrite of ...