WASHINGTON — It was one of the final pieces of legislation signed into law by President George W. Bush, a measure that passed without controversy, along with a pension bill and another one calling for national parks to be commemorated on quarters.

“This is a piece of legislation we’re very proud to sign,” a White House spokesman, Tony Fratto, told reporters on Dec. 23, 2008, as the president put his pen to the William Wilberforce Trafficking Victims Protection Reauthorization Act of 2008, named for a 19th-century British abolitionist. “This program has been very effective around the world in trying to stop trafficking in persons.”

Now the legislation, enacted quietly during the transition to the Obama administration, is at the root of the potentially calamitous flow of unaccompanied minors to the nation’s southern border.

Originally pushed by a bipartisan coalition of lawmakers as well as by evangelical groups to combat sex trafficking, the bill gave substantial new protections to children entering the country alone who were not from Mexico or Canada by prohibiting them from being quickly sent back to their country of origin.