China on Thursday completed a test of its Mars exploration lander ahead of Beijing's first mission to the red planet slated for 2020.

Beijing is pouring billions into its military-run space programme, with hopes of having a crewed space station by 2022.

Thursday's hovering and obstacle-avoidance test, which took place in northern Hebei province, was conducted in a facility that simulated conditions on Mars.

A red platform with steel cables attached mimicked the planet's gravity -- about a third that of Earth -- as the lander descended from a tall, metal structure.

The test is "an important part" of China's plans to land on Mars, said Zhang Kejian, director of the China National Space Administration (CNSA).

"Currently, all development work is going smoothly," he said in a statement.

China is pushing to catch up with the United States and become a space power, with ambitions of a manned lunar landing.

Earlier this year it made the first ever soft landing on the far side of the moon, deploying a rover on the surface.

Experts said Thursday's successful landing test was key in planning the future mission.

"I'm pretty optimistic about China's 2020 Mars exploration mission," said Jiao Weixin, a professor at the School of Earth and Space Sciences at Peking University.

"Hovering and avoiding obstacles is very key to whether or not the probe can land safely," added Jiao.

A China National Space Administration photo of an exploration lander for China's Mars mission
A China National Space Administration photo of an exploration lander for China's Mars mission China National Space Administration / Wan Ke

If the landing fails, so does the entire expedition, he said.

China's first Mars mission will focus on "orbiting and landing" on the planet, where a craft will "perform a patrol survey on the surface", said Zhang Rongqiao, the mission's chief designer, at Thursday's test.

"After the probe is launched, it will take seven months to reach Mars," he added.

The final landing process will only last about seven minutes, but is "the most difficult and the most challenging part of the whole mission".

China now spends more on its civil and military space programmes than Russia and Japan, and is second only to the United States.

Although opaque, its 2017 budget was estimated at $8.4 billion by the Organization for Economic Cooperation and Development.

The CNSA emphasised Beijing's desire to collaborate with other countries and institutions at Thursday's test, which was observed by dozens of diplomats and foreign journalists.

China has plans for future space missions, including "asteroid exploration missions and many more lunar missions", said Zhang, the CNSA director.

"Let us join hands in making an effort to advance space technology," he said.