In this June 6, 2013 file photo, a sign stands outside the National Security Agency (NSA) campus in Fort Meade, Md. (Patrick Semansky/AP)

Mike Lee, a Republican, represents Utah in the Senate.

More than four years ago, Congress passed, and President Obama signed, the Patriot Sunsets Extension Act of 2011.

Since that day, May 26, 2011, it’s been known that key provisions of our nation’s counterterrorism surveillance programs are set to expire this June 1.

That is why Rep. Bob Goodlatte (R-Va.), Rep. John Conyers Jr. (D-Mich.), Sen. Patrick J. Leahy (D-Vt.) and I worked diligently on a bipartisan and bicameral basis to produce the USA Freedom Act.

As with any legislation, the USA Freedom Act is not perfect. It does end the bulk collection of phone records and other data by our nation’s intelligence agencies, but it also represents compromises by the intelligence community and civil libertarians. The bill is the product of thousands of hours of work.

Mindful of the June 1 deadline, the House moved the act through its Judiciary Committee and to the floor, where it passed in a 338-to-88 vote on May 13.

At that point, it would have been prudent for the Senate to take up the legislation so that the ever-present conflicts between civil liberties and national security could have been fully and openly debated. Instead, we began debating trade-promotion authority, even though there was no looming deadline or pressing reason to do so.

On May 19, when it became clear that the trade issue would not be finished in time to allow debate on the expiring national security programs, I went to the floor and moved that the Senate temporarily set aside the trade issue and immediately begin debate on the USA Freedom Act.

That motion was blocked, again in favor of trade, leaving these key counterterrorism programs at great risk of interruption.

Then, on May 22, as the trade debate was wrapping up, a post-midnight vote on the USA Freedom Act was finally scheduled. We could have begun debate, considered amendments and been done by Wednesday.

Again, a real debate was thwarted. My exhausted colleagues were pressured to vote against the bill under threat of canceling the entire Memorial Day ­recess.

That is how we got where we are today. That is why these programs are set to expire on June 1.

I do understand that many of my colleagues, especially on the Republican side of the aisle, have very honest and substantive problems with the USA Freedom Act. They should be given an opportunity to voice their concerns and have their desired changes voted on.

Unfortunately, that debate may no longer be possible before these programs expire. The best way forward now is for the Senate to quickly pass the USA Freedom Act as-is and go back later to make any changes.

I understand that many Republicans are concerned that the six-month transition period between the current program and the program outlined by the USA Freedom Act is too short. The director of the National Security Agency has said that six months is plenty of time, but other viewpoints are legitimate.

Either way, a six-month transition period is presumably superior to immediate expiration, which is what we will face if the Senate does not immediately pass the USA Freedom Act. Once the act is passed, concerned senators will have six months to pass whatever tweaks they feel are necessary.

Whatever the outcome, the American people deserve better than this. Vital national security programs that touch on our fundamental civil liberties deserve a full, open, honest and unrushed debate. They should not be subject to cynical government-by-cliff brinkmanship.

If Congress, particularly Republicans in Congress, ever wants to improve its standing among the American people, it must abandon this habit of political gamesmanship.

The sooner the Senate acts on the USA Freedom Act, the better.