WASHINGTON (CNN) -- Congressional leaders reached a deal Thursday to extend key provisions of the Patriot Act, the government's premier anti-terrorism law.

Under the deal, 16 provisions set to expire at the end of the year will be extended for four more years, Sen. Arlen Specter, chairman of the Senate Judiciary Committee announced.

Negotiations had been stalled for months because of concerns that some provisions may violate civil liberties and give the FBI too much power to probe deeply into people's private lives.

Specter said the compromise produced a law that is "acceptable" but not perfect.

The provisions had been a key stumbling block, but Senate and House negotiators agreed to extend them for four years, rather than the 10 years favored by the White House and leading lawmakers.

The provisions include the two most controversial elements -- secret FBI access to library and business records and roving wiretaps. A "lone wolf" provision that sets standards for monitoring terror suspects who might be operating independently also survived.

Roving wiretaps involve eavesdropping devices that prevent a target from evading law enforcement officials by switching phones or computers.

Some congressional leaders were concerned that if the provisions were kept on the books for another decade they would not have had an opportunity to review any possible civil liberties violations.

The controversial U.S. anti-terrorism law passed in the months after the September 11, 2001, attacks and expanded government surveillance powers.

Other aspects of the law that allow suspects to be held without access to lawyers have prompted numerous legal challenges.

The deal marks Congress' first revision of the law.

Lawmakers have said they are trying to find the nation's comfort level with expanded law enforcement power in the post-September 11 era -- a task that carries extra political risks for all 435 members of the House and a third of the Senate facing midterm elections next year.