In the emotional wake of 9/11, a shocked and grieving nation demanded answers and justice. Lawmakers pledged to provide both with the Patriot Act.

Fifteen years later, the law dramatically expanded the government's ability to gather surveillance, broadened the definition of terrorism and sought to strengthen border security. It led to roving wiretaps and the much-criticized collection and storage of U.S. citizens’ phone and internet metadata while requiring communications companies to hand over that data.

The law, and subsequent revelations about government surveillance of Americans, also helped push a GOP-dominated Congress to move to narrow the scope. The law also ultimately helped force into the public sphere a debate over the conflict between the government’s desire to protect its citizens and its citizens’ civil liberties.

Protesters hold up signs outside of Federal Hall during a demonstration against United States Attorney General John Ashcroft September 9, 2003 in New York City. The Attorney General was in New York City as part of a sixteen-city tour speaking tour in which he spoke about the progress America has made on the war on terrorism through law enforcement and implementation of the USA Patriot Act. Spencer Platt / Getty Images file

"The Patriot Act went far beyond technological updating and I think it was passed in the heat of the moment and went too far,” said Peter Swire, a professor of law and ethics at the Georgia Institute of Technology who served as part of President Obama’s Review Group on Intelligence and Communications Technology. The review group was formed after whistleblower Edward Snowden's revelations about the government's domestic surveillance programs.

"In many ways, we’ve been trying to correct its excesses ever since," Swire said.

Rapid Response

It was less than a month after the deadly attacks on Sept. 11, 2001, and the nation was in mourning.

So too were lawmakers who worked to craft legislation they hoped would help prevent anything like it from ever happening again on U.S. soil.

Nathan Sales was fresh off a judicial clerkship and working at the Office of Legal Policy at the Department of Justice when he found himself part of the effort to help draft the USA PATRIOT Act, or the Uniting and Strengthening America by Providing Appropriate Tools Required to Intercept and Obstruct Terrorism Act of 2001. The task was a daunting one: Promote information sharing between law enforcement and the intelligence community in an effort to ward off future attacks.

Flames and smoke pour from a building at the Pentagon on Sept. 11, 2001. WILL MORRIS / AP

"The laws were so that it was harder to investigate terrorists than Tony Soprano," Sales told NBC News. "The right hand needs to know what the left hand is doing. Cops and spies, everyone needs to be talking."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Sales, who is now a professor at Syracuse University School of Law, said the law did just that as well as offered the intelligence community some of the same intelligence gathering tools used by law enforcement, such as wiretapping.

But while Sales, his co-authors and the measure's sponsors lauded the legislation, Sen. Russ Feingold, D-Wisconsin, was troubled.

"My goal has always been to combat terrorism and keep Americans safe while upholding the Constitution," Feingold told NBC News in a statement. "Instead of prioritizing global terror threats, I knew that the PATRIOT Act was hastily written to infringe upon the privacy and civil liberties of the very citizens it should protect. The facts have borne that out over the years."

Forty-five days after the Sept. 11 attacks, and after very little debate on the Senate floor, Congress passed the Patriot Act. The anti-terrorism law would eventually become one of the nation’s most hotly-debated pieces of legislation.

Feingold was the sole senator to vote against the measure's passage.

As the Smoke Cleared

The law has evolved through the years as the Patriot Act and its subsequent re-authorizations gave the government power to conduct and collect broad surveillance for the sake of fighting terrorism on U.S. soil.

But the law also faced sharp criticism by civil liberties groups.

"The law essentially gave the government the ability to get a lot of information and lowered the standard for them to be able to get it," said Neema Singh Guliani, legislative counsel for the American Civil Liberties Union.

Public outrage and the debate over privacy boiled over in 2013 when Snowden, a former CIA employee and government contractor, leaked information on National Security Agency surveillance revealing the broad extent of government data collection.

Among Snowden’s revelations were the NSA’s bulk collections of phone and internet metadata from U.S. users as well as the personal communications of foreign leaders, including U.S. allies — all sanctioned under the Patriot Act.

News about the NSA's domestic surveillance changed the online behavior of many Americans. Twenty-five percent say they have “changed the way they use technology at least somewhat after the Snowden revelations,” according to a Pew Research study in 2015.

A man protests the Patriot Act during an anarchist rally on the final day of the Democratic National Convention at Copley Plaza July 29, 2004 in Boston. Michael Springer / Getty Images file

Section 215 of the law became its most controversial aspect, sparking outrage and protest among civil liberties advocates due to the nature of the law’s scope. Section 215 authorized the NSA's bulk collection of telephone metadata, including who called whom when, but not what was said during conversations.

Section 215 also gave the government power to collect “tangible things,” including “books, records, papers, documents, and other items” on any “relevant” matters to counter terrorism.

“It became much easier for the government to collect information with very little transparency, which is the perfect storm for government abuse,” Singh Guliani said. “The law was interpreted quite expansively.”

REUTERS/Dado Ruvic

Bulk amounts of metadata, like phone records and internet search history, were included as relevant information under the act’s broad interpretation.

“There should be privacy and sanctity in our homes and in our papers, and individuals should be able to live without feeling like the government is spying on them,” Singh Guliani said.

While the questions about privacy and civil liberties is entirely legitimate and even necessary, the “concerns are misplaced,” Sales said. For example, the government must prove to a judge that a court order for a wiretap is necessary to pursue a criminal matter.

"The costs and the impact is low. The NSA doesn’t care about the email to your child’s preschool teacher," he said. "The benefit of the law is that it gives government counterterrorism capabilities it would not otherwise have had. It’s easier for cops, spies and soldiers to find the bad guys."

In recent years, Congress has moved to re-evaluate and improve the law with bipartisan changes that have helped dial back the law's reach, Swire said.

"One big change was the USA Freedom Act in 2015. A Republican Congress and President Obama agreed to substantial improvements in privacy protections, which closely paralleled our review group’s recommendations," Swire said. "Congress also closed down the Section 215 database (the telephone metadata database) and the USA Freedom Act helped put new limits on bulk collection on communications data.”

Ultimately, one of the most tangible impacts of the Patriot Act is a heightened awareness of the need to balance civil liberties and checks on government, Swire said.

“Since the birth of the republic, we’ve been split between having our civil liberties and having stronger government powers. And these cycles continue. Look at during World War II — we were willing to intern Japanese-Americans in camps because of what we believed was in our safest interest. But the 2015 law has helped rebalance our feelings about civil liberties and stronger government," Swire said. "It’s a sign that the emergency of 2001 is over and we can have a different national conversation about what makes sense for us as a country. After all, we didn’t abolish the NSA and the FBI, but we created stronger safeguards on government surveillance."