WASHINGTON (AFP) - US President Barack Obama on Thursday signed into law a four-year extension of controversial counter-terrorism search and surveillance powers at the heart of the Patriot Act. The president signed the act into law after it was approved by Congress and just before the provisions were to expire at midnight (0400 GMT Friday), extending measures adopted in the wake of the Sept 11, 2001 attacks. The White House issued a brief statement that Obama had signed the extension into law from France, where he is currently attending a G8 summit. FBI and intelligence officials had warned that if the Patriot Act was not extended by the deadline they would be robbed of crucial tools in the fight against terrorism - including wiretapping. "I have no doubt that the four-year Patriot Act extension, that members of both parties will agree to today, will safeguard us from future attacks," said Senate Republican leader Mitch McConnell. Meanwhile, the US House of Representatives passed a $690 billion Pentagon budget Thursday that bars American ground forces in Libya and limits the Obama administration's powers on handling Guantanamo detainees.