The House has narrowly rejected a proposal to block the National Security Agency’s bulk collection of data on all phone calls placed in the United States. The amendment to the annual Pentagon funding bill would have kept NSA phone spying to specific targets instead of the mass dragnets currently in place. The measure brought together a broad group of Republicans and progressive Democrats for the first major showdown on government spying since Edward Snowden’s leaks were disclosed last month. The final vote was 217 to 205, closer than expected. On the eve of the vote, the Obama administration deployed a lobbying effort to reject the bill, sending NSA director Keith Alexander to meet with lawmakers. In a separate vote, the House also rejected a measure that would have blocked funding for perpetual war under the 2001 act authorizing the so-called war on terror.