In another historical moment for the Obama administration, the Senate on Tuesday evening confirmed the long-stalled nomination of Eric Fanning to be Army secretary.

Fanning thus becomes the first openly gay leader of any U.S. military service.

The voice vote came after Sen. Pat Roberts, R-Kan.m dropped his opposition in a dispute over Obama administration efforts to close the prison at Guantanamo Bay, Cuba, and transfer detainees to the U.S.

Roberts said he received assurances from the administration in private discussions that the clock has run out on moving detainees to Fort Leavenworth, Kansas.

Fanning served as the Army secretary’s principal adviser on management and operation of the service. He was undersecretary of the Air Force from April 2013 to February 2015, and for half a year was the acting secretary of the Air Force.

Fanning’s path to the post began roughly eight months ago, but was stymied when Roberts held up confirmation.

Related: First Openly Gay Army Secretary Nominee Stalled by Single Senator

“Let me be very clear on this — as a veteran, a Marine — I support Mr. Eric Fanning for this post,” Roberts said on the Senate floor late last month. “If the White House calls and assures me that terrorists held at Guantanamo will not come to Ft. Leavenworth, I will release the hold – immediately.”

Eric Fanning

Eric Fanning

Related: Obama to Nominate Eric Fanning for Army, Would Be 1st Openly Gay Service Chief

White House officials suggested Roberts was grandstanding and fellow senators pleaded with Roberts to lift his hold. Sen. John McCain, chairman of the Armed Services Committee — who calls Roberts a “good friend” — took the floor last month and pleaded with him to move the process along.

Watch: Sen. Pat Roberts Discuss Eric Fanning’s Nomination

The pushback centered on the president’s announcement of a long-anticipated pitch to Congress in February to close the detention facility at Guantanamo Bay. The Obama administration is considering 13 locations across the country, including seven existing prison facilities in Colorado, South Carolina and Kansas and six additional sites on current military bases.

Officials have said the plan doesn’t highlight a preferred site.

Related: Guantanamo Bay: Obama Announces Plan to Close Controversial Detention Facility

A number of lawmakers— especially from Republicans — balked at the president’s proposals.

However, Roberts remained entrenched in his opposition. In March he introduced a Senate resolution rejecting any efforts to transfer detainees from Guantanamo Bay to American facilities.