(Reuters) - U.S. lawmakers introduced legislation on Tuesday to end spy agencies' bulk collection of Americans' telephone data, setting up a potential showdown over the program, which expires on June 1.

Republican U.S. Representatives Bob Goodlatte and Jim Sensenbrenner and Democrats John Conyers and Jerry Nadler introduced the "USA Freedom Act" in the House of Representatives, seeking to tighten control of a program publicly exposed two years ago by former National Security Agency contractor Edward Snowden.

Similar legislation was introduced in the U.S. Senate by Democrat Patrick Leahy and Republican Mike Lee.

The bills would bar the bulk collection of Americans' telephone records under Section 215 of the USA Patriot Act and other intelligence authorities, and increase transparency and accountability in surveillance programs.

They are supported by privacy groups but will run into opposition in Congress and at the White House.

Democratic President Barack Obama and many other Republicans and Democrats in Congress want to retain the mass data-collection program as a national security tool, but with substantial changes.

But other lawmakers want it to continue unchanged.

Earlier this month, Republican Senate Majority Leader Mitch McConnell said he was sponsoring a bill to extend unchanged until Dec. 31, 2020, the Patriot Act provision, which the NSA has used to collect and store vast quantities of "metadata" charting telephone calls made by Americans.

However, McConnell said he intended his bill to be a base for lawmakers to start debate on the issue.