After a five hour-long drama, the U.S. Senate confirmed B. Todd Jones to be the next director of the Bureau of Alcohol, Tobacco, Firearms and Explosives on Wednesday, giving the agency its first permanent head since 2006.

Jones was confirmed 53-42, but not before Senate Democrats scrambled to find enough votes to head off a filibuster of his nomination. To pull it off, Democrats had to secure a switched vote from a Republican Sen. Lisa Murkowski on the Senate floor and fly in Democratic Sen. Heidi Heitkamp of North Dakota from halfway across the country to cast her vote.

Once he is sworn in, Jones, 56, will lead a law enforcement agency that has been at the center of a long-simmering gun-control debate in Congress. Jones has served as acting ATF director since August 2011 and U.S. Attorney for Minnesota since 2009.

President Obama nominated Jones as permanent director in January, just weeks after the December massacre at a Newtown, Conn., elementary school left 20 students and 6 staff dead, raising the stakes for the debate and the issue of firearms violence.

Gun control and law enforcement groups supported Jones' nomination, but the specter of opposition from gun rights groups held up the process until the National Rifle Association decided this week to remain neutral on Jones' confirmation.

Before the decision, some lawmakers feared that the influential gun-rights organization would use their votes to dock the grades it assigns to members of Congress.

As expected, Minnesota's U.S. Sens. Amy Klobuchar and Al Franken voted for Jones' confirmation. Last week, the senators nominated Twin Cities trial lawyer Andrew Luger as his successor.

Sen. Chuck Grassley of Iowa sought to stall Jones' nomination until investigators close the books on an ongoing probe into Jones' tenure as U.S. Attorney. The federal Office of Special Counsel is investigating allegations that Jones retaliated against Jeffrey Paulsen, an assistant U.S. Attorney in Minnesota, after he raised concerns about Jones' management style. The case remains in mediation.

Grassley also sought more information on what Jones knows about "Operation Fast and Furious," the ATF's botched gun-trafficking operation linked to the death of a border patrol agent.

But Grassley's bid to derail Jones' nomination lost steam after the National Rifle Association's decision.