The measure would overhaul the N.S.A.’s use of a section of the Patriot Act, which was passed after the Sept. 11, 2001, terrorist attacks, to justify collecting reams of telephone metadata — information about phone numbers called and the times of the calls. The phone companies, not the government, would hold those records, which would be accessible to the N.S.A. through a search warrant.

The program engendered intense controversy after Edward J. Snowden, a former N.S.A. contractor, exposed the extent of the government’s surveillance efforts. It has been complicated by a federal appeals court ruling this month that the telephone records program is illegal.

But administration officials emphasized that there was more at stake as the nation faces serious threats from the Islamic State and other terrorist groups. The same authority that has been used to collect the bulk telephone data allows national security investigators to obtain court orders for records — from hotels and banks, for instance — that pertain to an individual.

Also scheduled to expire on Sunday is the government’s ability to obtain a multiuse order known as a roving wiretap to track a terrorist or spy known to be switching telephones frequently to avoid detection. And the Federal Bureau of Investigation would lose a tool, never before used, to wiretap a so-called lone wolf terrorism suspect, one believed to be linked to terrorist activity but not to any particular group.