Eight months after he was first nominated, Eric Fanning was sworn in Wednesday as the Army's top civilian leader.

As the 22nd Army secretary, Fanning is responsible for all matters relating to the Army, from manpower and personnel to installations, financial management and weapons system and equipment acquisition.

Fanning, 47, is widely viewed as one of the most capable leaders in the Pentagon and has served in key leadership positions in the Army, Air Force and Navy. He also was Defense Secretary Ash Carter's chief of staff and one of his closest advisers. The Senate on Tuesday confirmed Fanning by unanimous consent.

"I'm honored by today's Senate confirmation and thrilled to return to lead the total Army team," Fanning said in a statement Tuesday. "I am looking forward to getting back to work with [Army Chief of Staff Gen. Mark Milley], and sincerely appreciative of Patrick Murphy's work as Acting Secretary over the past several months."

The confirmation also marked a milestone: Fanning is the first openly gay secretary of a military service.

Fanning's confirmation is "terrific for the Army," said Army Under Secretary Patrick Murphy, who served as the acting secretary while Fanning awaited Senate confirmation.

"We have a great leadership team now in place, and our country and our Army is lucky to have his leadership," Murphy said. "There is no one in national security that knows more about the inner workings of the Pentagon than Eric Fanning. He'll be a great leader for our Army family."

Murphy, who has been acting secretary since January, said his time in that job was "all hands on deck."

"We're a nation at war right now, and we've got to act like it," he said. "I did what I thought was best to keep the Army in good hands, and I think we're all anxious to get [Fanning] back on the team. With his leadership, we'll be in good hands."

Then-Acting Under Secretary of the Army Eric Fanning visits and observes training at Fort Benning and the Maneuver Center of Excellence. Fanning was sworn in as the Army secretary May 18.

Photo Credit: Patrick A. Albright/Army

The road to confirmation for Fanning was long and bumpy, especially for someone with his qualifications.

President Obama in September nominated Fanning for the Army's top civilian job to succeed then-Secretary John McHugh, who retired Nov. 1 after more than six years on the job. At the time of his nomination, Fanning had been serving as the acting under secretary of the Army since June.

Fanning was named the acting Army secretary after McHugh retired, but in January, he stepped down from that position while he waited for his confirmation hearing. The move took place after members of the Senate Armed Services Committee expressed "some concerns" about Fanning being slotted into the acting position.

Fanning sailed through his Jan. 21 hearing in front of the Senate Arms Services Committee, but he then faced a hold from Sen. Pat Roberts, R-Kan.

Roberts placed a hold on Fanning's nomination, similar to the one he placed on McHugh's nomination in 2009, when he learned that Fort Leavenworth, home to the U.S. Disciplinary Barracks in Kansas was being studied as a potential site for relocating prisoners if the facility in Guantanamo Bay, Cuba, is closed.

Roberts relinquished the hold this week after announcing on the Senate floor that he had received assurances that detainees from Guantanamo Bay would not be moved to Kansas.

ARLINGTON, VA - MAY 18: L to R, U.S. Secretary of Defense Ash Carter embraces Secretary of the Army Eric Fanning during his swearing-in ceremony in the Secretary's Dining Room at the Pentagon, May 18, 2016, in Arlington, Virginia. Fanning is the first openly gay leader of any U.S. military service. Fanning's confirmation comes five years after the Obama administration repealed the 'Don't Ask, Don't Tell' policy, which barred openly gay people from serving in the military and also prohibited closeted service members from revealing their sexual orientation. (Photo by Drew Angerer/Getty Images)
ARLINGTON, VA - MAY 18: L to R, U.S. Secretary of Defense Ash Carter embraces Secretary of the Army Eric Fanning during his swearing-in ceremony in the Secretary's Dining Room at the Pentagon, May 18, 2016, in Arlington, Virginia. Fanning is the first openly gay leader of any U.S. military service. Fanning's confirmation comes five years after the Obama administration repealed the 'Don't Ask, Don't Tell' policy, which barred openly gay people from serving in the military and also prohibited closeted service members from revealing their sexual orientation. (Photo by Drew Angerer/Getty Images)

U.S. Secretary of Defense Ash Carter swears in Secretary of the Army Eric Fanning, during a ceremony in the Secretary's Dining Room at the Pentagon, May 18, 2016, in Arlington, Virginia.

Photo Credit: Drew Angerer/Getty Images

Before leading the Army, Fanning served as the special assistant to the defense secretary and deputy secretary, according to his official bio. He helped manage Carter's transition when he became the defense secretary, built his leadership team, and oversaw the day-to-day staff activities of Carter's office.

From April 2013 through February 2015, Fanning served as the under secretary of the Air Force. During his tenure, he also served as the acting Air Force secretary while now-Secretary Deborah Lee James' nomination was stuck in Congress.

Fanning, a graduate of Dartmouth College, also has served as the deputy under secretary of the Navy.

As he takes the reins as the Army's top civilian leader, Fanning will lead the Army during a critical transition period that includes continuing budget constraints, growing demands for troops around the world, a troop drawdown that's poised to cut thousands more soldiers from the force, and growing instability around the world.

During his confirmation hearing, Fanning said that soldiers are his top priority.

"The Army is a force viewed by too many by its end-strength, [which is] just a number," he said at the time. "Few understand how long it takes to build an Army. Few understand the many missions of the Army. The Army's greatest strength is, of course, its soldiers. … If confirmed, these soldiers will be my highest priority, specifically making sure they're ready, which means making sure they're resilient, fully trained and properly equipped."