WASHINGTON — President Donald Trump announced Saturday that he's picked a battle-hardened commander who oversaw troops in Iraq and Afghanistan to be the nation's next top military adviser.

If confirmed by the Senate, Gen. Mark Milley, who has been chief of the Army since August 2015, would succeed Marine Gen. Joseph Dunford as chairman of the Joint Chiefs of Staff. Dunford's term doesn't end until Oct. 1. Trump said the date of transition is yet to be determined.

Trump tweeted the announcement, saying "I am pleased to announce my nomination of four-star General Mark Milley, Chief of Staff of the United States Army - as the Chairman of the Joint Chiefs of Staff, replacing General Joe Dunford, who will be retiring. I am thankful to both of these incredible men for their service to our Country!"

Dunford is a former commandant of the Marine Corps and commander of coalition troops in Afghanistan. Milley commanded troops during several tours in Iraq and Afghanistan.

Trump's decision, which he announced before leaving Washington to attend the annual Army-Navy football game in Philadelphia, caught some in the Pentagon by surprise on Friday. Normally an announcement on a new chairman wouldn't be expected until early next year. The officials said the Air Force chief, Gen. David Goldfein, was also a strong contender for the job, but they indicated that Milley has a very good relationship with the president.

Trump hinted earlier Friday that he would make an announcement on Saturday, when he attends the game and is expected to perform the coin toss to decide which team gets the ball first. "I can give you a little hint: It will have to do with the Joint Chiefs of Staff and succession," he said.

As the Army's top leader, he helped shepherd the groundbreaking move of women into front-line infantry and other combat positions, while warning that it would take time to do it right.

Milley is known as a charismatic, outgoing leader who has not been afraid to offer candid and sometimes blunt assessments to Congress. Last year he admonished the House Armed Services Committee for its inability to approve a defense budget, slamming it as "professional malpractice." And in 2016, he told lawmakers, in answer to a direct question, that women should also have to register for the draft now that they are allowed to serve in all combat jobs.

As the Army's top leader, he helped shepherd the groundbreaking move of women into front-line infantry and other combat positions, while warning that it would take time to do it right. More recently, he has worked with his senior officers to reverse a shortfall in Army recruiting when the service fell far short of its annual goal this year.

He also played a role in one of the Army's more contentious criminal cases. While serving as head of U.S. Army Forces Command at Fort Bragg, North Carolina, Milley was assigned to review the case of former Army Sgt. Bowe Bergdahl, who abandoned his post in Afghanistan and was held captive by the Taliban for five years.

Milley made the early decision to charge Bergdahl with desertion and misbehavior before the enemy. Bergdahl was eventually found guilty, reduced in rank to private, dishonorably discharged and fined $10,000, but was spared any additional prison time.

A native of Winchester, Massachusetts, and a fervent supporter of the Boston Red Sox and other city teams, Milley received his Army commission from Princeton University in 1980. An infantry officer by training, he also commanded Special Forces units in a career that included deployments in the invasion of Panama in 1989, the multinational mission in Bosnia-Herzegovina to implement the Dayton Peace Accords, and the Iraq war.

The Milley move starts a series of military leadership changes in coming months, including successors in 2019 for Adm. John Richardson as the chief of Naval Operations, Gen. Robert Neller as commandant of the Marine Corps, and Air Force Gen. Paul Selva as vice chairman of the Joint Chiefs. Trump also will pick a replacement for Milley as Army chief.

Goldfein began his term as Air Force chief of staff in 2016, so wouldn't be expected to step down until the summer of 2020.