Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

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

Fanning becomes the first openly gay leader of any U.S. military service — a milestone not lost on gay rights groups, coming five years after the repeal of "don't ask, don't tell," which had prohibited gay and lesbian service members from being open about their sexuality.

Eric Fanning at the 30th Space Symposium Corporate Partnership dinner in Colorado Springs, Colorado, in May 2014. Duncan Wood / U.S. Air Force via AP — file

"Eric Fanning's historic confirmation today as Secretary of the U.S. Army is a demonstration of the continued progress towards fairness and equality in our nation's armed forces," Human Rights Campaign President Chad Griffin said in a statement.

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

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

"I'm honored by today's Senate confirmation and thrilled to return to lead the total Army team," Fanning said in a statement Tuesday night.

The Morning Rundown Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The voice vote to confirm, Fanning, 47, came after Sen. Pat Roberts, R-Kansas, dropped his opposition in a dispute over Obama administration efforts to close the prison at the U.S. naval base at Guantanamo Bay, Cuba, and transfer detainees to the United States.

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

Rep. Nancy Pelosi, D-California, was among the first politicians to congratulate Fanning publicly Tuesday, tweeting that he is "capable, experienced & will lead with honor!"

Congratulations to Eric Fanning on historic appointment as the first openly gay @SECARMY. He's capable, experienced & will lead with honor! — Nancy Pelosi (@NancyPelosi) May 17, 2016

A slate of senators from both parties joined in the praise for Fanning. Sen. Sherrod Brown, D-Ohio, tweeted that Fanning's selection is "an historic moment for #LGBT servicemembers," while Sen. Dan Sullivan, R-Alaska, tweeted that he "appreciated (Fanning's) recognition of Alaska's strategic importance & need for larger @USArmy."

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

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

"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 Fort Leavenworth, I will release the hold — immediately."

White House officials suggested that Roberts was grandstanding, and fellow senators pleaded with him 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 urged 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 — particularly Republicans — balked at the president's proposals. But Roberts was especially entrenched in his opposition. In March, he introduced a Senate resolution to reject any efforts to transfer detainees from Guantanamo Bay to U.S. facilities.

After changing his mind to allow Fanning's confirmation to move forward, Roberts reiterated his belief on the Senate floor Tuesday that he always considered Fanning the right person to lead the military's largest branch, which has about 470,000 active troops.

"He will be a tremendous leader as Army secretary and will do great by our soldiers at Fort Leavenworth and Fort Riley," Roberts said before the vote.