In a letter to Congress, Mark Milley, the Chairman of the Joint Chiefs of Staff, said he did not envisage soldiers playing any role if Republicans and Democrats did not agree on the result.
Mr Trump has repeatedly voiced concerns that the election will be undermined by fraud during widespread mail-in voting amid the coronavirus pandemic, and suggested that the result may never be known.
Joe Biden, the Democrat nominee, has said he fears Mr Trump will try to “steal” the election but the military would “escort him from the White House with great dispatch.”
Democrat congresswomen Elissa Slotkin and Mikie Sherrill wrote to the general seeking answers as to what the military’s role would be.
In a written response General Milley, known to be a student of military history, wrote: “I believe deeply in the principle of an apolitical US military. In the event of a dispute over some aspect of the elections, by law US courts and the US Congress are required to resolve any disputes, not the US military.
“I foresee no role for the US armed forces in this process. We will not turn our backs on the Constitution of the United States.”
Ms Slotkin said: “These are just prudent questions to be asking given the things that the president has been saying publicly.”
She said the general’s answers “demonstrated that the chairman recognised the military’s role in our elections is to essentially stay out, that the military’s role in the peaceful transition of power is to stay out.”
Last month, Mr Trump said it was too early to guarantee he would accept the election results.
He said: “I have to see. Look, I have to see. No, I’m not going to just say yes. I’m not going to say no.”