President Obama signed an extension of the Patriot Act late Thursday, just hours before the law's provisions were set to expire.

The Senate was able break through legislative gridlock and pass the bill Thursday night, sending it to Obama, who is in Europe, for his signature. The president was expected to use an automated signature to sign the bill into law.

The Obama administration had pressured Congress to approve the four-year extension before the Friday deadline, arguing that if it were allowed to lapse for even a short period of time, it could endanger natonal security. 

Underscoring how negotiations went down to the wire, the White House sent out an announcement that the president signed the extension just minutes before it was set to expire.

But Sen. Rand PaulRandal (Rand) Howard PaulBusiness, conservative groups slam Trump’s national emergency declaration The Hill's 12:30 Report — Presented by Kidney Care Partners — Trump escalates border fight with emergency declaration On The Money: Trump declares emergency at border | Braces for legal fight | Move divides GOP | Trump signs border deal to avoid shutdown | Winners, losers from spending fight | US, China trade talks to resume next week MORE (R-Ky.) who is backed by the Tea Party, objected to several agreements to pass the bill, demanding that two of his amendments receive a vote. Senate leaders were able to hammer out a deal late Thursday to bring his amendments, and the broader bill, to the floor.

Both amendments failed.