Donald Trump's nominee to lead the Environmental Protection Agency (EPA) has been approved by the US Senate.
The vote was 52-46 as Republican leaders used their party's narrow Senate majority to push Scott Pruitt's confirmation despite calls from Democrats to delay the vote until requested emails are released next week.
As part of a public records lawsuit, a state judge in Oklahoma on Thursday ordered Mr Pruitt to release thousands of emails that he exchanged with oil and gas executives by Tuesday.
Mr Pruitt has refused to release the emails for more than two years.
Democrats boycotted a committee vote on his nomination last month, citing his refusal to hand over the emails, and on Friday called on Senate Majority Leader Mitch McConnell to delay the confirmation vote until the nominee turns over the thousands of requested emails from his time as Oklahoma attorney general.
Senate Democratic Leader Chuck Schumer of New York tried to draw a direct line between Mr Pruitt's withheld emails and last year's demands from President Donald Trump and congressional Republicans during the presidential campaign.
"Emails! Remember emails?" Schumer asked on the Senate floor. "'We should get them out!' they said about Hillary Clinton. If they weren't worried about them, then why rush?"
To dramatise their cause, Senate Democrats kept the Senate in session through the night with a series of speeches opposing his confirmation. Democrats were still marching to the floor at dawn.
As attorney general, Mr Pruitt filed 14 lawsuits challenging EPA regulations.
He joined a multi-state lawsuit opposing the Obama administration's plan to limit carbon emissions from coal-fired power plants.
Mr Pruitt also sued over the EPA's recent expansion of water bodies regulated under the Clean Water Act. It has been opposed by industries that would be forced to clean up polluted wastewater.
Mr Trump has tapped some of the wealthiest Americans to serve in his Cabinet, and ethics reviews have slowed the confirmation process. So have Senate Democrats, who have mostly opposed all the nominees and forced hours of debate.
So far, the Senate has confirmed 14 out of 22 Trump Cabinet or Cabinet-level picks requiring confirmation.
Mr Pruitt's nomination was strongly opposed by environmental groups and hundreds of former EPA employees, who predict he will roll back the agency's environmental enforcement efforts.
During his Senate confirmation hearing last month, Mr Pruitt said he disagreed with Mr Trump's past statements that global warming is a hoax.
However, Mr Pruitt has previously cast doubt on the extensive body of scientific evidence showing that the planet is warming and manmade carbon emissions are to blame.
The 48-year-old Republican is closely aligned in his home state with oil and gas companies, whose executives have backed his political campaigns.