Former presidents have to give up rides on Air Force One. But now they don't have to give up being shadowed by the armed-and-earpieced bodyguards of the Secret Service.

President Barack Obama on Thursday signed into a law a measure giving him, George W. Bush and future former presidents and their spouses lifetime Secret Service protection, the White House announced.

The legislation, crafted by Republican Rep. Trey Gowdy of South Carolina, rolls back a mid-1990s law that imposed a 10-year limit on Secret Service protection for former presidents. Bush would have been the first former commander in chief affected.

At the time, lawmakers who supported the measure said it would save the government millions of dollars. They also argued that former presidents could hire private security firms (as Richard Nixon did after he decided to forgo Secret Service protection in 1985).

The bill had sailed through Congress with bipartisan support—it cleared the House of Representatives by voice vote in early December, and then it zipped through the Senate unopposed. The law also provides protection for former presidents’ kids until age 16. But “protection of a spouse shall terminate in the event of remarriage.”

The Secret Service started protecting presidents in 1901 after the assassination of William McKinley. In 1965, Congress passed a law authorizing the agency, which is now a part of the Department of Homeland Security, to protect former presidents for life.