Donald Trump‘s nominee to become the next top US military officer has promised that, if confirmed, he would not be cowed by the White House as he provides advice on national security matters.

General Mark Milley, who serves as US Army chief of staff, appeared before the Senate Armed Services Committee (SASC) on Thursday at a moment when Mr Trump’s moves to pull the Pentagon into his border wall plans, Independence Day festivities and other initiatives have generated concerns about the erosion of the military’s nonpartisan traditions.

If confirmed, General Milley would replace Marine General Joseph Dunford Jr as chairman of the Joint Chiefs of Staff this autumn.

Senator Angus King asked General Milley if he would challenge the president, who since his 2016 election has questioned decades-old defence alliances and taken positions that have caused discomfort within the military highest ranks.

In response to the general’s vow to remain independent, Mr King said: “I believe that. But I think it’s very important to emphasise that the Oval Office is an intimidating place, and the president of the United States is the most powerful leader in the free world.”

Trump's inner circle: Meet the members of the US president's cabinet Show all 20 1 /20 Trump's inner circle: Meet the members of the US president's cabinet Trump's inner circle: Meet the members of the US president's cabinet Donald Trump's Cabinet Donald Trump's Cabinet is one the richest in American history, filled with billionaires, conservatives and several career politicians. AFP/Getty Trump's inner circle: Meet the members of the US president's cabinet Mike Pence US Vice President Mike Pence has defended Donald Trump throughout his presidency while walking a fine line to avoid any public involvement in major scandals. AFP/Getty Trump's inner circle: Meet the members of the US president's cabinet Mike Pompeo Secretary of State Mike Pompeo replaced Donald Trump's previous appointment to the post, Rex Tillerson, and has led talks with North Korea in establishing high-profile summits between the president and Kim Jong Un. Getty Trump's inner circle: Meet the members of the US president's cabinet Wilbur Ross Secretary of Commerce Wibur Ross raised controversy when he was accused of falsely claiming to have sold stock in a bank and violated a government ethics agreement. AFP/Getty Trump's inner circle: Meet the members of the US president's cabinet Robert Lighthizer US Trade Representative Robert Lighthizer has been a fixture in Donald Trump's ongoing trade spat with China. AFP/Getty Trump's inner circle: Meet the members of the US president's cabinet William Barr Attorney General William Barr replaced Jeff Sessions as the nation's top cop in early 2019 and has refused to commit to recusing himself from the Russia probe despite an unsolicited memo he sent to the Justice Department decrying the investigation. EPA Trump's inner circle: Meet the members of the US president's cabinet Rick Perry Energy Secretary Rick Perry has held his post throughout Donald Trump's presidency despite previously undermining the need for the agency he now leads in past public statements. Ken Shipp / United States Department of Energy Trump's inner circle: Meet the members of the US president's cabinet Betsy DeVos Education Secretary Betsy DeVos has also held her post throughout the presidency, despite major backlash to her apparent undermining of the nationwide public school system and advocacy for charter programmes. Getty Trump's inner circle: Meet the members of the US president's cabinet Steven Mnuchin Treasury Secretary Steven Mnuchin has faced numerous controversies throughout his tenure as the head of Treasury, including costing taxpayers at least a million dollars in travel expenses. AP Trump's inner circle: Meet the members of the US president's cabinet Robert Wilkie Veterans Affairs secretary Robert Wilkie was appointed after Donald Trump's White House doctor Ronny Jackson withdrew over allegations he provided prescription drugs to patients without prescriptions. AFP/Getty Trump's inner circle: Meet the members of the US president's cabinet David Bernhardt Secretary of the Interior David Bernhardt took office in January 2019 after the resignation of Ryan Zinke after previously serving as Zinke's deputy. Before taking office Bernhardt worked for many years as a solicitor for the Department of the Interior. Tami Heilemann / United States Department of the Interior Trump's inner circle: Meet the members of the US president's cabinet Elaine Chao Transportation Secretary Elaine Chao has held her post throughout the presidency and has mostly avoided controversy, despite a report claiming her office has been in frequent coordination with her husband's, Mitch McConnell. AFP/Getty Trump's inner circle: Meet the members of the US president's cabinet Kevin McAleenan Acting Secretary of Homeland Security Kevin McAleenan took over from Kirstjen Nielsen after she resigned in April 2019. He previously worked as the executive director of the executive director of the Office of Anti Terrorism in the Customs and Border Protection agency United States Customs and Border Protection Trump's inner circle: Meet the members of the US president's cabinet Ben Carson Secretary of Housing and Urban Development Ben Carson was appointed shortly after Donald Trump took office and raised controversy over an exorbitant furnishing bill for his office. Reuters Trump's inner circle: Meet the members of the US president's cabinet Gina Haspel CIA Director Gina Haspel was appointed in 2018 and faced backlash surrounding her oversight of Guantanamo Bay. Getty Trump's inner circle: Meet the members of the US president's cabinet Dan Coats Director of National Intelligence Dan Coats could be the next person to leave Donald Trump's administration over his refuting the president's claims surrounding ISIS. Reuters Trump's inner circle: Meet the members of the US president's cabinet Sonny Perdue Agriculture Secretary Sonny Perdue has been dogged by ethics questions throughout his tenure and faced controversy when emails showed the agency appeared willing to eagerly work with lobbyists under his leadership. Reuters Trump's inner circle: Meet the members of the US president's cabinet Alex Azar Health and Human Services Secretary Alex Azar is a former pharmaceutical lobbyist and former drug company executive. Getty Trump's inner circle: Meet the members of the US president's cabinet Mick Mulvaney Acting Chief of Staff and Office of Management and Budget Director Mick Mulvaney has described himself as one of the most conservative officials in the White House. EPA Trump's inner circle: Meet the members of the US president's cabinet Robert Wilkie Secretary of State for Veterans Affairs Robert Wilkie has spent his career on Capitol Hill serving in various roles in foreign affairs and defence. He holds the rank of Lieutenant Colonel in the US Air Force Reserve. Gene Russell / United States Department of Veterans Affairs

He added: “To be willing to say ‘Mr President, you’re wrong about this’ ... if it’s something that she or he doesn’t want to hear is just, there is no more important responsibility in your career.”

General Milley replied that Marine General Dunford and “most of us” have seen a lot of combat.

“Arlington is full of our comrades, and we understand absolutely full well the hazards of our chosen profession,” General Milley said, referring to the national cemetery a few miles away in Virginia where many US service members are buried.

“We know what this is about, and we will not be intimidated into making stupid decisions,” he said. “We will give our best military advice and not keep the consequences to ourselves.”

General Milley, a gruff infantry officer educated at Princeton, became the Army’s top officer in August 2015 after serving in Iraq, Afghanistan and other countries.

His nomination by Mr Trump last December, which came surprisingly early, defied the recommendation of then-Defence Secretary James Mattis, who had recommended the Air Force’s top officer, General David Goldfein.

It’s not clear how Mr Trump, who appears to have gained confidence in his instincts on foreign policy as his presidency has gone on, would take to being challenged by General Milley.

Mr Mattis, who during his initial period as Pentagon chief steered defence policy back towards traditional positions, resigned in December over Mr Trump’s treatment of key allies.

General Milley would take on new responsibilities for an institution experiencing intense leadership upheaval.

This week, officials unveiled a plan for installing the Defence Department’s third acting secretary this year, as federal personnel rules require acting defence secretary Mark Esper – who has been serving as General Milley’s civilian counterpart leading the Army since 2017 – to step aside while SASC considers whether to confirm him for the top Pentagon job.

Senate officials on Thursday said Mr Esper’s confirmation hearing would take place on 16 July.

Donald Trump says stone-throwing migrants could be shot by US military

Also this week, the man poised to become the Navy’s top officer, Admiral William Moran, announced he would instead retire over his connection to a Navy officer accused of treating female personnel inappropriately.

The president intends to announce Vice Admiral Mike Gilday, the director of the Joint Staff at the Pentagon, as his next pick to lead the Navy, a senior US official said on Thursday. The news was first reported by the Wall Street Journal.

The nominee to become Joint Chiefs vice chairman, Air Force General John Hyten, faced questions about whether he will be confirmed following a revelation on Wednesday that he has been investigated for an alleged sexual assault.

Military officials investigated and found no evidence of wrongdoing, but some lawmakers said on Thursday that they would like to hear more from the alleged victim, an army colonel who told The Washington Post that she is willing to testify.

Finally, General David Berger took over as the new commandant of the Marine Corps on Thursday.

Speaking during a brisk hearing in which no senator raised questions about his credentials, General Milley echoed other Pentagon leaders in affirming that China posed a threat to US military superiority.

He said the international order that emerged after World War II was “under the most stress since the end of the Cold War“.

“From East Asia to the Middle East to Eastern Europe, authoritarian actors are testing the limits of the international system and seeking regional dominance, while challenging international norms and undermining US interests,” he said.

Much of General Milley’s job as chairman will involve tending to America’s military alliances as the president, who has espoused a transactional view of those relationships, questions their value.

US military plan to spread viruses using insects could create ‘new class of biological weapon’, scientists warn

General Milley must also navigate his duty to execute the commander in chief’s orders while mitigating the impact of internally unpopular decisions, such as the initiative to use military funds to pay for Mr Trump’s border wall.

Privately, senior officers have also voiced concern that the involvement of active duty troops in a mission designed to stem migration at the southern border will detract from the military’s core mission.

Responding to questions from Senator Mazie Hirono, General Milley said he would resign if he was asked to carry out an order that was “illegal, immoral or unethical”.

Amid recent tensions with Iran, General Milley said the US withdrawal from the 2015 nuclear deal had complicated Washington’s ability to build a coalition to confront Tehran’s steps to challenge US interests and allies in the region.

He said he did not expect war with Iran.

General Milley voiced support for the Pentagon’s refusal to transfer advanced F-35 jets to Turkey, a Nato ally, if it acquires Russian-made S-400 air and missile defence systems.

“The S-400 is a Russian system built to shoot down aircraft like the F-35,” he said.

Mr Trump has called the S-400 issue “complicated” and said the US is “looking at different solutions”.

General Milley also said he would recommend deploying land-based missiles to the Pacific if the United States proceeds with its planned withdrawal from the Intermediate-Range Nuclear Forces (INF) treaty, a Cold War-era pact the Trump administration says Russia is violating.