Mike Pompeo | Alex Wong/Getty Images Pompeo confirmed as US secretary of state Most Democrats opposed the nominee for his hawkish views on foreign policy.

The U.S. Senate confirmed Mike Pompeo to be President Donald Trump’s secretary of state on Thursday, after a handful of Democrats facing difficult reelection challenges joined every Republican in backing the CIA director.

Pompeo’s hawkish foreign policy views drew strong opposition from the left, but he ultimately won over Democratic Sens. Heidi Heitkamp of North Dakota, Joe Manchin of West Virginia, Joe Donnelly of Indiana, Bill Nelson of Florida, Claire McCaskill of Missouri and Doug Jones of Alabama.

Pompeo, who was confirmed on a 57-42 vote, is expected to be quickly sworn in and then jump on a plane to Brussels for a Friday meeting of NATO foreign ministers.

The Trump administration had little margin for error. With Sen. John McCain (R-Ariz.) out recovering from cancer treatment, Republicans’ majority had slimmed to 50-49. Libertarian-leaning Sen. Rand Paul (R-Ky.), a member of the Senate Foreign Relations Committee, had also initially announced his opposition to Pompeo.

The former Kansas congressman was poised just days ago to get an unfavorable recommendation from the Senate Foreign Relations Committee until Paul flipped, citing assurances from the president and incoming secretary that the war in Iraq was a “mistake” and that the U.S. should wind down its presence in Afghanistan.

Republican leaders were determined to bring Pompeo’s nomination to the floor regardless of the committee vote. But had Paul remained opposed, he and Democrats could have killed the nomination outright.

Paul’s shifting position, however, all but assured Pompeo would breeze though Thursday’s confirmation. Republicans maintained that he is well-qualified to be America’s top diplomat and criticized Democrats for playing politics with his nomination. Fourteen Senate Democrats had voted to confirm him as CIA director in January 2017.

“From the founding of the republic until 2017, the Senate has never required a cloture vote to confirm a secretary of state nominee. Now we’re at two,” Senate Majority Leader Mitch McConnell complained earlier Thursday. “I guess Senate Democrats are in a history-making mood. Because over the past 15 months, they’ve embarked on a partisan campaign to block, obstruct and delay President Trump’s nominees that is quite simply without precedent in American history.”

Pompeo was among a trio of controversial Cabinet and Cabinet-level nominees the president named in recent weeks, and he is excepted to have the easiest time getting confirmed.

Pompeo’s deputy at the CIA, Gina Haspel, is expected to have her confirmation hearing to succeed him as CIA director next month. Department of Veterans Affairs secretary nominee Ronny Jackson withdrew from consideration Thursday morning following allegations that he drank on the job and was a loose dispensary of pills on foreign trips.

The Senate is scheduled to hold a procedural vote on Richard Grenell, who was nominated to be the ambassador to Germany. He could be confirmed as early as Thursday afternoon.