An Oklahoma judge has ordered Scott Pruitt, the state's attorney general, to release emails related to his dealings with energy companies. On Friday, the Senate voted to confirm Pruitt's nomination to lead the US Environmental Protection Agency.

State Judge Aletia Haynes Timmons, of the District Court in Oklahoma County, said Thursday that Pruitt's office must turn over thousands of emails related to communications with fossil fuel interests that are not exempt by Oklahoma records law.

The order is a response to records requests filed by the Center for Media and Democracy that date back to January 2015; those records must be relinquished by February 21, Timmons ruled. Other requests made by the watchdog group later in 2015 and 2016 must be handed over within 10 days, The Oklahoman reported.

"You just can't sit on them for two years," Timmons told Pruitt's attorneys at a hearing on Thursday, according to The Oklahoman.

Judge ordered release of thousands of emails between EPA nom Pruitt & energy co.s by Tuesday; today's vote must be postponed til we see them

The Wisconsin-based Center for Media and Democracy filed a lawsuit on February 7 claiming that by not responding to the group's records requests in a timely fashion, Pruitt's office was in violation of the Oklahoma Open Records Act.

"They were non-responsive and the judge found, as a matter of law, that was an abject failure to abide by the Open Records Act," said the organization's attorney, Robert D. Nelon.

On February 10, Pruitt's office released 411 documents related to the initial January 2015 records request, Nelon said, though Timmons said that about 3,000 documents are part of that request, The Oklahoman reported.

The deadlines for Pruitt's office will fall after February 17, when Pruitt was confirmed by the US Senate to be the next administrator of the US Environmental Protection Agency. Before Friday's vote, Senate Democrats, desperate to delay the vote, have pointed to the records lawsuit as reason to retard Pruitt's confirmation.

"Sometime — a week from now, maybe days from now — my fear is that a number of members, especially on the other side, will have been put in a very bad position and asked to vote for a nominee that they otherwise may not have supported had they known," Sen. Tom Carper (D-Delaware) said Thursday, according to Politico.

.@SenateGOP are jamming through Pruitt at @EPA before his emails come out. At 12:30pm, @SenateDems will force a vote to extend the debate.

As Oklahoma's attorney general, Pruitt made a name for himself lobbing legal attacks at the very agency he will command. Opponents of his nomination to lead the EPA allege that Pruitt has very close ties with fossil fuel interests.

"Over the past five years, Pruitt has used his position as Oklahoma's top prosecutor to sue the EPA in a series of attempts to deny Americans the benefits of reducing mercury, arsenic, and other toxins from the air we breathe; cutting smog that can cause asthma attacks; and protecting our wetlands and streams,"wrote Rhea Suh, president of the National Resources Defense Council.

In a January letter to the Office of Government Ethics, Senate Democrats, concerned about Pruitt's potential conflicts of interest as an EPA head, said that "[d]uring his tenure as attorney general of Oklahoma, Mr. Pruitt has blurred the distinction between official and political actions, often at the behest of corporations he will regulate if confirmed to lead the EPA."

The Democratic senators added that Freedom of Information Act requests have revealed that "Mr. Pruitt and his staff have worked closely with fossil fuel lobbyists to craft his office's official positions."