U.S. President Donald Trump picked retired generals for some of his most senior national security posts when he took office and boasts of heavy spending on the military that he asserts is unmatched in history.

He has made getting U.S. allies to increase their own military spending a cornerstone of foreign policy along with a commitment to walk away from "ridiculous endless wars” in the Middle East that have killed thousands of U.S. troops.

But the Republican president has also ridiculed his top generals, ignoring their advice on some key issues and questioning their intelligence, courage and commitment to their soldiers.