Beijing (CNN) China's Defense Ministry has praised outgoing US Defense Secretary James Mattis, saying Beijing "highly appreciated" his attitude during his time in the post.

In the Chinese government's first response to the former general's impending departure, Defense Ministry spokesman Wu Qian said: "(Mattis) made positive efforts in making military-to-military relations a stabilizer in the overall China-US relationship."

Wu said Beijing also looked forward to having a "sound and stable" relationship with Mattis's successor, acting Defense Secretary Patrick Shanahan, when he takes over on January 1.

Mattis' time in the Pentagon's top job came amid rising political, economic and military tensions between the US and China, including a more assertive stance by Washington in the South China Sea and large weapons sales to Taiwan.

US Defence Secretary Jim Mattis and China's Defence Minister Wei Fenghe inspect and honour guard during a welcome ceremony at the Bayi Building in Beijing on June 27.

The former US general resigned from the post on December 20 , saying his views were no longer "aligned" with those of President Donald Trump.