The Senate confirmed a chief critic of the Environmental Protection Agency to lead the agency in a narrow, mostly partisan vote Friday.

Scott Pruitt received the support of 52 senators (including two Democrats), while 46 (including one Republican) voted against him.

Democrats had been trying to rally support against the EPA pick, including with an overnight session Thursday into Friday, but in the end it wasn’t successful.

The effort was helped by EPA employees, who, in an unprecedented move, tried to kill his nomination.

Pruitt comes to the cabinet position from Oklahoma, where he served as the red-state’s attorney general. He opposed the EPA in 14 lawsuits over the years, often accusing the agency of overreach.

Pruitt has been accused of being too cozy with oil and gas companies, and even faced a TV ad campaign to try to rally public opposition to him.

The Democrats who supported Pruitt’s confirmation were Joe Manchin (D-WV) and Heidi Heitkamp (D-ND), while Susan Collins (R-Maine) opposed it.

President Trump now has over half his cabinet confirmed — 14 of 22 positions. But while his first pick to be labor secretary withdrew earlier this week — and was replaced by Trump Thursday — it’s widely believed the rest of nominees will get through the Senate confirmation process.