President Obama praised outgoing Defense Secretary Chuck Hagel on Wednesday as "a true American patriot" and "a man from the heartland who devoted his life to America."

During his two years at the Pentagon, Hagel helped wind down the war in Afghanistan, maintain the military during tough budget times, battle the Ebola virus at its source in West Africa, and coordinate the fight against the Islamic State in Iraq and Syria, Obama said during a farewell ceremony at Joint Base Fort Myer-Henderson Hall.

"Chuck has helped prepare us for the century ahead," Obama said.

Hagel, who reportedly announced his resignation under political pressure in November, thanked the president and dedicated most of his remarks to the troops.

"To the men and women who serve our country — and their families, whose service and sacrifice is unequaled — you have my deepest gratitude," Hagel said.

Obama has nominated former Pentagon official Ashton Carter to replace Hagel. Carter is expected to win Senate confirmation after confirmation hearings that begin Feb. 4.

From left: US Secretary of Defense Chuck Hagel, President Barack Obama, Vice President Joe Biden and Chairman of the Joint Chiefs of Staff Gen. Martin Dempsey stand at attention Jan. 28 during the playing of the national anthem.

Photo Credit: Win McNamee/Getty

The president, who served with Hagel in the U.S. Senate, noted that he is the first Vietnam combat veteran to serve as Defense secretary. Obama also praised the Nebraska Republican for bringing a bipartisan spirit to national defense issues, both in the Senate and at the Pentagon.

Vice President Biden, who also served with Hagel in the Senate and spoke at the ceremony, told him that "you are a man whose judgment and counsel I've always sought."

While various news reports have cited ongoing tensions between Hagel and Obama's team — including Pentagon complaints they were being micromanaged by the White House — officials were all complimentary at the farewell event.

Obama told Hagel that "you've always been frank" and "said what you thought."

More In The Americas