WASHINGTON — Senior members of the House Judiciary and Intelligence committees have agreed on similar but rival bills that would restrict the National Security Agency’s ability to collect Americans’ phone call data in bulk.

The Judiciary Committee is expected on Wednesday afternoon to mark up and pass a compromise version of a bill sponsored by Representative James Sensenbrenner, Republican of Wisconsin. It has the support of several top lawmakers of both parties on that panel. The Intelligence Committee is expected to mark up and pass a similar bill on Thursday, staffers said.

Both bills would curtail the government’s ability to collect bulk records about Americans. In particular, the bills are aimed at ending the N.S.A. program that systematically gathers logs about Americans’ phone calls and stores them for at least five years. Instead, they would authorize a system in which the bulk records would stay with the phone companies, and the government could obtain records of callers up to two links from a suspect.

Neither bill would require phone companies to hold onto such records longer than they normally would do — in the case of landline phone records, up to 18 months. President Obama has endorsed the broad outlines of such a plan.