The Senate on Thursday narrowly confirmed Rep. Jim Bridenstine, R-Okla., as NASA administrator, despite deep concerns from Democrats that he lacks the scientific and management expertise to lead the space agency.

The vote to install the three-term lawmaker was 50-49. President Trump had initially tapped Bridenstine for the post last year, but his nomination stalled amid Democratic criticisms, as well as some reticence from Sen. Marco Rubio, R-Fla., who said Thursday that NASA should be led by a professional with a background in space.

But Rubio ultimately sided with all other Republicans to confirm Bridenstine as the NASA chief in spite of his hesitations, arguing that Trump deserves to have his team in place across the administration.

“I was not enthused about the nomination. Nothing personal about Mr. Bridenstine. NASA is an organization that needs to be led by a space professional,” Rubio said before the confirmation vote Thursday. But “my view of it is, and it has been the tradition of the Senate for the entire distance of the republic, that we give great deference to the president on choosing qualifications.”

Bridenstine’s confirmation comes at a critical time for the agency, which is preparing to return to the moon, and to restore human spaceflight from United States soil, a capability that was lost when the space shuttle program was retired in 2011.

The space agency has gone without a permanent leader for 15 months, since Charles Bolden resigned as Trump took office. During that time, Robert Lightfoot, a NASA veteran, has been running the agency. But he recently announced he was retiring from the agency at the end of this month.

Bridenstine is a former naval aviator who ran the Tulsa Air and Space Museum before coming to Congress in 2013.

An avid supporter of space exploration, he sponsored the American Space Renaissance Act, a wide-ranging bill that touched on national security, how best to deal with debris in space, and how to regulate the commercial space industry.

Earlier this week, Vice President Mike Pence praised Bridenstine as “a great champion of the men and women at NASA and a great champion of the president’s vision for NASA, and for American leadership in space.”

But Democrats seized on Bridenstine’s lack of scientific expertise, as well as his comments on climate change, to make their case that Bridenstine was unfit to lead the agency. Sen. Bill Nelson, D-Fla., who led the Democrats’ opposition to the congressman, also argued that the NASA administrator should be a professional, rather than a politician.