PARIS — A law that gives French intelligence services sweeping new spying abilities has cleared a final hurdle after France’s Constitutional Council widely approved the legislation.

In a ruling published late on Thursday evening, the council said it had struck down only a handful of unconstitutional provisions in the law, which gives French spying agencies the power to use phone taps, set up hidden cameras or microphones, and conduct bulk analysis of metadata, with almost no judicial oversight.

The ruling paves the way for the rest of the law to officially come into effect after it was passed in Parliament last month.

The Socialist government, which introduced and pushed for the legislation, has argued that it is necessary to overhaul a legal framework for intelligence operations that predates the widespread use of cellphones and the Internet, especially in the face of increased terrorist threats. The government also said that intelligence operatives would have to go through a new supervisory commission for any surveillance operations.