The fight over the future of the National Security Agency’s phone record and Internet data collection programs had its first skirmish in the House in July, with a vote that nearly defunded the phone record initiative. And Congress has been building toward a prolonged — and potentially nasty — battle this fall and winter.

New shots could be fired as soon as next week. After some false starts, the Senate Intelligence panel is tentatively scheduled for a closed-door intracommittee showdown over draft legislation sponsored by panel leaders. Also next week, senior members of the House and Senate Judiciary panels are likely to roll out their own joint proposal, one committee aide said.

The usual allegiances and animosities have been shattered on each side: Despite months of being at each others’ throats over the debt limit and a government shutdown, the Obama administration and Democratic and Republican party leaders in both chambers have united on the defensive. They’re trying to hold off a push from a coalition composed of the liberal left and libertarian right to end the phone record collection program entirely.

Frequent allies in the Senate such as Judiciary Chairman Patrick J. Leahy of Vermont and Intelligence Chairwoman Dianne Feinstein of California are at odds on the left, while hawkish House Republicans such as leading Judiciary Committee member Jim Sensenbrenner of Wisconsin and Intelligence Chairman Mike Rogers of Michigan are at odds on the right. With many of their constituents angry about the expansive surveillance, lawmakers have at times gotten personal in the high-stakes dispute.

Advocates of the program to collect phone record metadata such as call location and duration argue that such a program could have prevented the Sept. 11 terrorist attacks and does not gravely threaten privacy thanks to Hill and court oversight. Opponents argue that it represents a vast, unnecessary increase in the amount of information the NSA collects on U.S. citizens and has almost no national security value.