WASHINGTON — The movement to crack down on government surveillance started with an odd couple from Michigan, Representatives Justin Amash, a young libertarian Republican known even to his friends as “chief wing nut,” and John Conyers Jr., an elder of the liberal left in his 25th House term.

But what began on the political fringes only a week ago has built a momentum that even critics say may be unstoppable, drawing support from Republican and Democratic leaders, attracting moderates in both parties and pulling in some of the most respected voices on national security in the House.

The rapidly shifting politics were reflected clearly in the House on Wednesday, when a plan to defund the National Security Agency’s telephone data collection program fell just seven votes short of passage. Now, after initially signaling that they were comfortable with the scope of the N.S.A.’s collection of Americans’ phone and Internet activities, but not their content, revealed last month by Edward J. Snowden, lawmakers are showing an increasing willingness to use legislation to curb those actions.

Representatives Jim Sensenbrenner, Republican of Wisconsin, and Zoe Lofgren, Democrat of California, have begun work on legislation in the House Judiciary Committee to significantly rein in N.S.A. telephone surveillance. Mr. Sensenbrenner said on Friday that he would have a bill ready when Congress returned from its August recess that would restrict phone surveillance to only those named as targets of a federal terrorism investigation, make significant changes to the secret court that oversees such programs and give businesses like Microsoft and Google permission to reveal their dealings before that court.