WASHINGTON -- Oklahoma Attorney General Scott Pruitt on Friday won Senate confirmation to head the Environmental Protection Agency, a federal agency he repeatedly sued to rein in its reach during the Obama administration.

The vote was 52-46 as Republican leaders used their party’s narrow Senate majority to push Pruitt’s confirmation despite calls from Democrats to delay the vote until requested emails are released next week.

Two Democrats voted to confirm Pruitt: Sen. Heidi Heitkamp of North Dakota and Sen. Joe Manchin of West Virginia. Just one Republican voted against Pruitt: Sen. Susan Collins of Maine. Two senators did not vote: Democratic Sen. Joe Donnelly of Indiana and Republican Sen. John McCain of Arizona.

Get Breaking News Delivered to Your Inbox

As part of a public records lawsuit, a state judge in Oklahoma on Thursday ordered Pruitt to release thousands of emails that he exchanged with oil and gas executives by Tuesday. Pruitt has refused to release the emails for more than two years.

Democrats boycotted a committee vote on Pruitt’s nomination last month, citing his refusal to hand over the emails, and on Friday called on Senate Majority Leader Mitch McConnell, R-Kentucky, to delay Pruitt’s confirmation vote until the nominee turns over the thousands of requested emails from his time as attorney general.

Senate Democratic Leader Chuck Schumer of New York tried to draw a direct line between 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 dramatize 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 daybreak.

As attorney general, Pruitt filed 14 lawsuits challenging EPA regulations. He joined a multistate lawsuit opposing the Obama administration’s plan to limit planet-warming carbon emissions from coal-fired power plants. 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.

Pruitt is also a known climate change skeptic. In an op-ed published earlier this year in The National Review, Scott Pruit argued that global warming is “far from settled,” despite the overwhelming consensus among scientists that human activities are behind the accelerated warming of the planet, with consequences ranging from vanishing polar ice to extreme weather patterns worldwide to the loss of coral on the Great Barrier Reef and food supplies for already endangered species.

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.

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, Pruitt said he disagreed with Mr. Trump’s past statements that global warming is a hoax. However, Pruitt has previously cast doubt on the extensive body of scientific evidence showing that the planet is warming and man-made 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. Though Pruitt ran unopposed for a second term in 2014, public campaign finance reports show he raised more than $700,000, much of it from people in the energy and utility industries.

The Center for Media and Democracy filed multiple public records requests for Pruitt’s emails to coal, oil and gas corporations going back to 2015. It sued him last week.

In a hearing Thursday, Oklahoma District Court Judge Aletia Haynes Timmons concluded “there really is no reasonable explanation” for why Pruitt’s office hasn’t complied with the request for his emails. Timmons ordered Pruitt to turn over the records by Tuesday and to comply with other open records requests by the group in 2015 and 2016 within 10 days.

Pruitt’s office says about 400 documents were turned over on Feb. 10, but Timmons says more than 3,000 have been withheld.