WASHINGTON – After a five-hour drama, the U.S. Senate confirmed Minnesota U.S. attorney 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 were forced into a last-minute scramble for votes to head off a Republican filibuster of his nomination.

To secure the 60 votes necessary to close debate, Democrats lobbied Republican Sen. Lisa Murkowski of Alaska to switch her vote. Still short, they delayed for hours while North Dakota Sen. Heidi Heitkamp, who has been sick all week, flew to the capital to cast the decisive cloture vote.

It was a tension-filled day in what has been a contentious confirmation process for Jones, who faced questions about his management style and allegations of retaliation against whistleblowers.

Jones, 56, of St. Paul, will take the helm of a law enforcement agency at the center of an increasingly volatile gun-control debate in Congress.

Jones has led the bureau as acting director since 2011, when he was tapped to help it bounce back after the infamously botched "Fast and Furious" gun-smuggling operation, which led to the death of a U.S. Border Patrol agent.

"Todd Jones is a tough and tested law-enforcement professional with decades of experience, and his confirmation to lead the Bureau of Alcohol, Tobacco, Firearms and Explosives is both welcome and long overdue," President Obama said in a statement.

Jeanne Cooney, spokeswoman for the U.S. attorney's office in Minneapolis, said Jones would issue a statement Thursday. She said Jones "is appreciative of the vote."

Obama nominated Jones as the permanent director in January, just weeks after a massacre of children at a Newtown, Conn., elementary school intensified the debate over firearms violence in the nation.

An ex-Marine Corps infantryman, Jones has served as Minnesota's U.S. attorney during the Obama and Clinton administrations.

Minnesota's U.S. senators, Amy Klobuchar and Al Franken, were staunch supporters of Jones' confirmation throughout his ordeal, but Klobuchar proved a key player in brokering the vote switch that made confirmation possible.

During the cloture process, Klobuchar was among Democratic senators who swarmed Murkowski on the floor, persuading her to flip her vote.

The episode was further evidence of cracks in the tenuous compromise that Democrats and Republicans reached to preserve the filibuster for Obama appointees.

"For nearly seven years, Senate Republicans had refused to confirm an ATF director — not because they thought the nominees weren't qualified, but because they put politics ahead of the agency's law enforcement mission," Obama said in a statement. "I applaud Senator Reid, Senator Leahy, Senator Klobuchar, and the bipartisan group of senators who broke through that gridlock to give Todd Jones the up or down vote he deserved."

With Sen. Majority Leader Harry Reid, D-Nev., threatening to rewrite filibuster rules, Republicans relented last week, allowing confirmation of several Obama appointees. But Jones was not part of the pact.

Led by Sen. Chuck Grassley of Iowa, Jones' nomination encountered stiff resistance from Republicans from the start.

Law enforcement and gun control groups backed Jones' nomination, but the specter of opposition by the gun lobby held up the process until this week, when the National Rifle Association announced that it was neutral on Jones' confirmation.

Grassley struggled till the end to block Jones' nomination, renewing his objections on the Senate floor Wednesday and urging his colleagues to stall until investigators closed the books on an ongoing probe into his tenure as U.S. attorney.

The federal Office of Special Counsel has investigated allegations that Jones retaliated against whistleblower Jeffrey Paulsen, an assistant U.S. attorney in Minnesota, after Paulsen raised concerns about Jones' management style. That case is still in mediation.

Grassley also sought to pry more information from Jones about "Fast and Furious," the gunrunning scandal that was the subject of a months-long congressional inquiry.

As part of the Patriot Act renewal in 2006, federal law changed in 2006 to require Senate confirmation of the ATF director. Gun rights advocates have objected to every nominee since, blocking attempts to win approval for a permanent director to lead the agency until Jones' confirmation Wednesday.

Jones earned his juris doctorate from the University of Minnesota in 1983, then went on active duty in the Marine Corps, where he served as a trial defense lawyer and prosecutor and saw combat duty during the Gulf War. He joined the U.S. attorney's office in the 1990s and was appointed U.S. attorney in 1998 by then-President Bill Clinton. He returned to the private sector in 2001, becoming a partner in the Twin Cities law firms of Greene Espel and later Robins, Kaplan, Miller & Ciresi. Ultimately, he returned to the role of U.S. attorney, this time under Obama.

On Wednesday, Tom Heffelfinger, former U.S. attorney in Minnesota, said Jones' confirmation is "good news."

"This was not and never has been a partisan political position," Heffelfinger said. "In fact the Senate failed to confirm Mike Sullivan, who was nominated for the same position by George W. Bush. This is a good day for our law enforcement community."

Michael Davis, chief federal judge in Minnesota, also lauded the Senate's action. "As a longtime friend of B. Todd Jones. … I am personally gratified that he has been confirmed," Davis said. "The district of Minnesota has been well served by his tenure as U.S. attorney for two different presidents."

Don Oswald, special agent in charge of the Minneapolis FBI office from May 2011 to May 2012, now retired, was a critic of Jones, saying that he failed to support the prosecution of individuals involved in violent crime, gangs and drugs, an allegation disputed by others in the law enforcement community.

Wednesday night, Oswald didn't back down, saying: "The process has spoken. I think the information that was brought to light during the process informed the people of the type of manager that he was and I hope he is a better ATF director than he was a U.S. attorney."

Klobuchar, who said Wednesday she is "confident that [Jones] will serve the country well," has recommended that former Assistant U.S. Attorney Andy Luger succeed him.

Franken said he is confident Jones will provide the ATF with "valuable direction and leadership."

Staff writer Randy Furst contributed to this report. Corey Mitchell is a correspondent in the Star Tribune Washington Bureau.