Eric Fanning greets Col. Dan Dant, 460th Space Wing commander at Buckley Air Force Base, Colo., in 2013. (Senior Airman Marcy Glass/U.S. Air Force)

President Obama, in a historic first for the Pentagon, has chosen to nominate Eric Fanning to lead the Army, a move that would make him the first openly gay civilian secretary of one of the military services.

Fanning, 47, has been a specialist on national security issues for more than two decades and has played a key role overseeing some of the Pentagon’s biggest shipbuilding and fighter jet programs. Now he will oversee an Army that has been battered by the longest stretch of continuous combat in U.S. history and is facing potentially severe budget cuts. It’s also an Army that after a long stretch of patrolling Iraqi and Afghan villages is searching for its postwar role in protecting the nation.

Fanning’s nomination, which must go to the Senate for confirmation, reflects a major shift for the Pentagon, which only four years ago prevented openly gay troops from serving in the military. The policy didn’t extend to civilian leaders, such as Fanning.

His long tenure in the Pentagon and his breadth of experience in shepherding some of the department’s most complex and sensitive weapons programs was a key factor in his nomination for the Army’s top job, administration officials said.

“Eric brings many years of proven experience and exceptional leadership to this new role,” Obama said in a statement.

President Obama nominated Eric Fanning as the next secretary of the Army, paving the way for the first openly gay leader of a U.S military service branch. (Reuters)

Fanning’s rise to one of the Pentagon’s toughest and most prominent jobs also reflects the Obama’s commitment to diversity at the highest levels of his administration. During his time in office, Obama has overhauled internal policies to provide federal benefits to same-sex partners, appointed gay men and lesbians to the executive branch and the federal courts and ended the 18-year ban on gays serving openly in the military.

As Army secretary, Fanning will be teamed with Gen. Mark Milley, who took over in August as the Army’s top general, the chief of staff. The two men will assume responsibility for the Pentagon’s largest and most troubled service.

The Army, which swelled to about 570,000 active-duty troops during the height of the wars in Iraq and Afghanistan, has shed about 80,000 soldiers in recent years and plans to cut 40,000 more over the next few years. The planned cuts would shrink the service to its smallest size of the post-World War II era.

Battered by the wars in Iraq and Afghanistan, the Army has had to deal with a spike in suicides as the wars drew to an end. Recently, the Army’s outgoing chief of staff, Gen. Ray Odierno, said that tight budgets and the ongoing strain of 14 years of war had badly degraded the Army’s readiness to fight and that only one-third of its brigades were prepared to deploy to a war zone, the lowest readiness rate in decades.

In a sign of how much the country has changed in the past decade, Fanning’s sexual orientation seemed a non-issue among Republicans and Democrats in Congress, who were far more worried about the state of the Army.

“There is a real crisis in morale and retention that has developed for the Army over the last several years,” said Joe Kasper, chief of staff to Rep. Duncan D. Hunter (R-Calif.). “The Army needs a leader who will stand up for soldiers, who recognizes war can get ugly and who won’t shy away from the tough issues. If Fanning is that type of person, he’ll be embraced.”

Fanning’s historic appointment didn’t seem to cause a stir in the Army, either.

“My sense is that the Army is over this and has been over it for some time,” said Phil Carter, a veteran of the war in Iraq and senior fellow at the Center for a New American Security. “The Army cares whether you can shoot straight, not whether you are straight.”

Fanning’s role as Army secretary would give him influence over the selection of the generation of generals who will rebuild the service after the wars. One big question for the Army is whether, in an era of tight budgets, it will return primarily to preparing for heavy combat missions against a big, conventional military, such as the Russians, or experiment with new formations that are better suited to training and working alongside indigenous partners.

“The biggest problem the Army faces is finding its mission, relevance and purpose after the Iraq and Afghanistan wars,” Carter said. “All of the services face it, but the Army faces it most acutely.”

Fanning has been a trusted ally of Defense Secretary Ashton B. Carter, who tapped Fanning last year to oversee his transition team as he moved into the Pentagon’s top job. He also served briefly as acting Air Force secretary, a deputy undersecretary of the Navy and has been acting undersecretary of the Army since June 2015.

Fanning’s new boss in the Pentagon described him as “one of our country’s most knowledgeable, dedicated, and experienced public servants.”

Defense officials said that Fanning might be the only person in history to serve at senior levels in all three services. “He understands how the Pentagon works and how to get things done in the Pentagon,” said Rudy de Leon, who was deputy defense secretary in the Clinton administration. “He knows what works and what doesn’t work.”

Fanning’s knowledge of the costly and complicated world of weapons development is needed in the Army, which has struggled to field new combat systems in recent decades. Since 2000, the Army has been forced to cancel virtually all of its major new weapons programs because they ran over budget or didn’t perform as expected.

New battlefield equipment for the wars in Iraq and Afghanistan, such as special armored vehicles designed to resist blasts from roadside bombs, had to be developed outside of the Army’s traditional procurement channels.

The net result is that many of the Army’s most sophisticated helicopters, tanks and artillery were developed more than 30 years ago.

“The Army is still living off equipment from the Reagan years,” de Leon said. With ­budgets tight, Fanning’s challenge will be to upgrade and modernize the aging fleet using modern information technology.