President Donald Trump’s pick for attorney general, Sen. Jeff Sessions, was confirmed Wednesday night in a near-party-line vote in the Senate, finishing off a contentious process and leaving pro-gunners cheering, and gun control groups jeering.

The Senate voted 52-47 to confirm Sessions. Democrat Joe Manchin III broke the party line and voted for Sessions, something he said he’d do back in November. No Republican voted against the senator from Alabama, and while he could have voted to confirm himself Wednesday night, Sessions voted present.

The vote follows days of attacks by Democrats against Trump’s cabinet appointees. First, an all night “talkathon” aimed at derailing Trump’s pick for education secretary, Betsy Devos. That failed. Then Sen. Elizabeth Warren was silenced by Republican leaders when she started reading a letter written by Coretta Scott King in 1986 which was critical of Sessions. Sen. Tom Udall continued reading the letter, but the last minute attempts at swinging votes fell on deaf ears.

“The NRA and our five million members would like to congratulate Jeff Sessions on his confirmation as attorney general,” said NRA-ILA’s Executive Director Chris W. Cox Wednesday in a statement. “He will make America a safer place by prosecuting violent criminals while protecting the Second Amendment rights of law-abiding gun owners.”

“During his confirmation hearings, Jeff Sessions said he would enforce the gun laws already on the books,” wrote Everytown for Gun Safety President John Feinblatt in a statement. “Now we will find out if the new attorney general is a man of his word – and willing to call the NRA’s bluff, enforce the law and side with police and the public against the gun lobby.”

During his confirmation hearing before the Senate Judiciary Committee last month, Sessions did say he would “systematically prosecute criminals who use guns in committing crimes.”

“As United States Attorney, my office was a national leader in gun prosecutions nearly every year. We will partner with state and local law enforcement to take down these major drug trafficking cartels and dismantle criminal gangs,” he said.

Sessions is a longtime supporter of gun rights, and has earned an A+ rating from the NRA.