Sen. John Cornyn (R-Tex.) walks past the Senate subway as debate continued on renewing the USA Patriot Act. (Andrew Harnik/AP)

It was the fall of 2001 and John Cornyn was getting ready to run for the U.S. Senate when terrorists sent a jolt through the world and changed the politics of national security forever.

“I remember when my wife pointed . . . to the TV, when the second plane hit the tower,” the Texas Republican, now the Senate’s majority whip, recalled Tuesday afternoon.

Congress swept into action, approving a war resolution against terrorists and, six weeks after the Sept. 11 attacks, the USA Patriot Act was introduced. It passed the House by an overwhelming margin the next day. It cleared the Senate the day after that with just one dissenting vote.

Almost 14 years later, the national security debate is completely different in both parties. This week, a leading Republican presidential candidate, Sen. Rand Paul (Ky.), briefly short-circuited the nation’s surveillance laws, and then an overwhelming majority of senators, including Cornyn, voted Tuesday for a measure that would rein in portions of the once overwhelmingly popular Patriot Act.

“I think it’s pretty stark,” Cornyn said before the final roll call, comparing 2001 to 2015.

Roving wiretaps, the NSA phone records collection and the "lone wolf" provision are some of the most controversial parts of the Patriot Act. PostTV breaks down what you need to know about these sections. (Jorge Ribas/The Washington Post)

A large bloc of Republicans, whose ranks include Senate Majority Leader Mitch McConnell (Ky.) and Sen. John McCain (Ariz.), cling to the post-9/11 ethos that surrendering a little bit of personal privacy is worth it, if it gives authorities a chance to catch terrorists and avert another 9/11-type disaster.

Thirty of the 53 GOP senators who voted opposed the new, less sweeping surveillance legislation — all but Paul on grounds that it was too weak. But that group now realizes that it no longer controls the debate as it used to.

“That sense of urgency has clearly died off in the intervening years,” McCain said after the vote.

Yet majority sentiment still remains far from Paul’s civil libertarian vision of completely turning off the intricate system of pulling together metadata of phone, texting and e-mail and sifting through to find any terrorist connections.

Instead, a bipartisan majority in Congress is now clearly on record supporting an aggressive spying culture, just one that is a little more restrictive than the intelligence agencies would like, and one with more judicial oversight.

After all, McConnell and Paul both lost on Tuesday. They voted against the USA Freedom Act, one because he thought it was too weak and the other because he thought it preserved a culture of intrusive, Big Brother government.

Sen. Patrick J. Leahy (D-Vt.), a lead sponsor of the new measure, said the smartest thing he ever did was to find a like-minded conservative partner 14 years ago, Richard K. Armey (R-Tex.), who was the House majority leader at the time, willing to ensure that the Patriot Act included a time-limit mechanism that would force a review of the policies.

“We wouldn’t have the debate if Armey and I hadn’t been able to form the coalition and put the sunsets in,” Leahy said Tuesday.

That set up the first big review of the Patriot Act for the summer of 2005, but even then many of the actions being taken were still classified and reports about warrantless wiretapping by security agencies would not begin to emerge until late 2005 and early 2006. As a senior member of the Judiciary Committee, Sen. Richard J. Durbin (D-Ill.) remembered that he was barely allowed to speak about the amendments that he was offering in order to modify the very classified portions of the law.

“I couldn’t even explain publicly what it was all about. I had to say in the most general terms of principles what we were doing,” Durbin said Tuesday.

By the spring of 2008, many details about the wiretapping program had broken into public view, and Congress held a full debate about how to update the 1978 law that governed those actions, the Foreign Intelligence Surveillance Act (FISA), which established a special federal court to consider warrants for monitoring individuals overseas.

Intended as a curb against domestic spying — its original co-sponsor was Edward M. Kennedy (D-Mass.) in 1977 — critics considered it outdated more than 30 years later.

The drumbeat against the military and covert intelligence services complex seemed to hit a crescendo among Democrats that spring of 2008. Then-Sen. Barack Obama (D-Ill.) used his opposition to the Iraq war as a wedge against then-Sen. Hillary Rodham Clinton (D-N.Y.) to secure the Democratic presidential nomination, and Rep. Nancy Pelosi (D-Calif.) had become the most liberal House speaker in history.

Still, even then, after much debate with the Bush White House, Obama and Pelosi threw their support behind only slight modifications to FISA, which protected the telecommunications companies from the threat of lawsuits for turning over data to spy agencies.

That bill passed by very similar margins to this year’s legislation: 293 votes in the House in 2008 and 338 last month; 69 votes in the Senate in 2008 and 67 on Tuesday.

Just as McConnell found himself the odd man out this week, Senate Minority Leader Harry M. Reid (D-Nev.), the majority leader in 2008, was on the sidelines then, protesting from the left against the rewrite of the FISA bill. Reid voted against the bill, which the other leading Democrats of the day endorsed.

That 2008 debate may have been the beginning of the bipartisan coalition that triumphed on Tuesday, but first it had to withstand the early wave of anti-government tea party activism.

The biggest threat to enhanced powers for the intelligence community came in a series of wave elections: huge Democratic victories in 2006 and 2008, based on deep antiwar sentiments, and sizable Republican gains in 2010, fueled by belief that the federal government needed to be reined in.

That sequence of events created a large bloc of libertarian-minded Democrats and Republicans in Congress, and in early 2011, just weeks into his tenure running the House, Speaker John A. Boehner (R-Ohio) and his leadership team got its first lesson that today’s Republicans aren’t reflexively hawks.

Some Patriot Act provisions were expiring, but Boehner’s team considered them so noncontroversial that their renewal was put on the fast-track calender: no debate, no amendments, and more than two-thirds majority required for approval, in much the same way post offices are named.

Instead, the bill did not win the needed supermajority, and the embarrassed Boehner leadership team had to pass it under normal rules days later.

In the past two years, however, the emergence of two crucial players have collided to alter the debate: Edward Snowden and the Islamic State. Snowden, a former National Security Agency contractor, revealed to The Washington Post and Britain’s the Guardian newspaper in 2013 just how vast the NSA’s collection of bulk data was, sweeping up millions of connections among Americans with no ties to terrorists.

The revelations drew deep outrage from the public, but then in late 2014, Islamic State forces began their advance in Syria and Iraq, punctuated by a series of beheadings of hostages that included U.S. citizens. The public was much more focused on national security issues again, and the unease was only heightened by terrorist attacks in Europe by radical extremists. That push and pull set the dynamic for the debate the past month.

“Snowden’s argument is that government has gone too far, the ISIS argument is how far does government need to go to protect us,” Durbin said. “That is the tension.”

For now, that tension has created what many consider a bipartisan middle ground, but plenty of lawmakers worry that the ground could shift again.

“Security really is on people’s minds these days,” Sen. Rob Portman (R-Ohio), who faces reelection in 2016 and opposed Tuesday’s vote, “and it will be for a long time because I don’t think the threat’s going to go away.”