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 PaulDem wins Kentucky state House seat in district Trump won by 49 points GOP's tax reform bait-and-switch will widen inequality Pentagon budget euphoria could be short-lived 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.