The Senate on Thursday confirmed Thomas Perez to be the next Secretary of Labor after narrowly crossing the 60-vote threshold the day before to end a lengthy filibuster of the nominee.

Perez, previously an assistant U.S. attorney general in the civil rights division, will replace outgoing secretary Hilda Solis.

“At the Department of Labor, Tom will help us continue to grow our economy, help businesses create jobs, make sure workers have the skills those jobs require, and ensure safe workplaces and economic opportunity for all,” President Obama said.

Obama tapped Perez to head the Labor department in March, but the nomination was held up for months by Republicans seeking changes to the department and the National Labor Relations Board. Perez, too, was painted as a controversial pick by conservatives hoping to block confirmation.

But Perez ultimately won approval as part of an 11th hour compromise by Republicans not to stand in the way of five Obama appointees if Senate Majority Leader Harry Reid, D-Nev, pulled back from the so-called “nuclear option.” Reid threatened to use his 54-member majority to break Senate rules and end the filibusters of seven Obama nominations without the 60 votes needed to end debate.

Reid ultimately stepped away from that threat and Democrats pulled back two Obama appointees to the NLRB, while Republicans stopped their filibuster of the other five nominations.

Obama thanked Senators for “agreeing to move forward on Tom and the other nominees who have waited far too long for the yes-or-no votes they deserve.”

Sen. Marco Rubio, R-Fla., pleaded with Republicans until the last minute to continue filibustering Perez, but he received the 60 votes necessary for cloture and gained final confirmation on a 54-46 vote — the closest tally for any of Obama’s second term cabinet confirmations .

“The fact is this nominee has been more than thoroughly vetted,” said Sen. Tom Harkin, D-Iowa. “He has the character, the integrity, and the expertise to lead the Department of Labor. He has been an asset to the Department of Labor and the entire country.”

Senators will vote later Thursday to end debate on another Obama nominee, Gina McCarthy, to head the Environmental Protection Agency. Like Perez, McCarthy was initially held up by Republicans but is expected to gain confirmation as part of the bipartisan accord reached earlier this week.