President Barack Obama called for a smooth handover of control of the U.S. military to incoming commander in chief Donald Trump, as the outgoing president met Wednesday with military leaders for the last time.

"We've got to make sure that during this transition period that there is a seamless passing of the baton, that there's continuity," Obama said. He said it was critical to ensure that "we are doing everything we can to make sure that the next president will benefit from the same kinds of outstanding advice and service that these people around the table have provided me."

Obama's comments as he sat down with the Joint Chiefs of Staff and the military's combatant commanders came amid concerns in military and diplomatic circles about how Trump may handle national security challenges. Over the last few days, Trump has disputed the U.S. intelligence community's assessments about Russian hacking, insisted without explanation that North Korea won't develop a nuclear weapon that could hit the U.S. and questioned the worth of the United Nations.

Obama pointed to a handful of conflicts that Trump will inherit when he takes office on Jan. 20, including the fight against the Islamic State group in Syria and in the Iraqi city of Mosul, the biggest IS stronghold in Iraq and last major Iraqi city where the extremist group still has control. He also noted that the conflict in Afghanistan "is still active."

In praising the military, Obama appeared to call attention to traditions that Democrats are most concerned that Trump may not uphold. Trump has nominated retired Marine Corps Gen. James Mattis for defense secretary despite the prohibition on recently departed military members running the civilian-led Pentagon, and at one point in the campaign, Trump called for reinstating waterboarding and other harsh interrogation techniques.

Obama said he was optimistic about the country's future because the military upholds "the values of rule of law and professionalism and integrity, and recognizes our constitutional structure and maintains strict adherence and respect for civilian authority and democratic practices in determining how we use the awesome force of the American military."

The president was also honored at a farewell ceremony at Joint Base Myer-Henderson Hall, a short drive from the White House.

Addressing a room of men and women from the various branches of the military, Obama praised their service and sacrifice. He said there is "no greater privilege and no greater honor" than serving as commander in chief.

"As I reflect on the challenges we have faced together and on those to come, I believe that one of the greatest tasks before our armed forces is to retain the high confidence that the American people rightly place in you," Obama said. "We must never hesitate to act when necessary to defend our nation, but we must also never rush into war because sending you into harm's way should be a last and not first resort."

Prior to his remarks, Defense Secretary Ash Carter presented Obama with the Medal of Distinguished Public Service as a token of appreciation for his service as commander in chief.