WASHINGTON — The government’s authority to sweep up vast quantities of phone records in the hunt for terrorists expired at 12:01 a.m. Monday after Senator Rand Paul, Republican of Kentucky, blocked an extension of the program during an extraordinary and at times caustic Sunday session of the Senate.

Still, the Senate signaled that it was ready to curtail the National Security Agency’s bulk data collection program with likely passage this week of legislation that would shift the storage of telephone records from the government to the phone companies. The House overwhelmingly passed that bill last month. Senators voted, 77 to 17, on Sunday to take up the House bill.

Mr. Paul’s stand may have forced the temporary expiration of parts of the post-9/11 Patriot Act used by the National Security Agency to collect phone records, but he was helped by the miscalculation of Senator Mitch McConnell, the majority leader, who sent the Senate on a weeklong vacation after blocking the House bill before Memorial Day.

Mr. McConnell, also of Kentucky, relented Sunday, setting up a final round of votes on Tuesday or Wednesday that will most likely send a compromise version of the House bill to President Obama for his signature. Even Mr. Paul, using the procedural weapon of an objection, conceded he could not stop that.