Jan Hecker, Germany's ambassador to China, has died after serving in the position for only a few days, the Foreign Ministry said Monday morning.

The 54-year-old Hecker, a former adviser to German Chancellor Angela Merkel, had just taken up the role on August 24, the consulate in the Chinese capital announced on its social media WeChat account.

"We're deeply saddened and shocked to learn of the sudden death of the German Ambassador to China," CNN quoted a representative of the German Foreign Ministry as saying Monday.

"Our hearts are with Hecker's family and his friends and colleagues at this time," the spokesperson said. The circumstances surrounding the ambassador's death were not disclosed.

Hecker and his family arrived in China in August, and he had submitted his diplomatic credentials and had started performing in his capacity as diplomat at the end of the month.

In 2015, after joining Merkel's chancellery office, he worked as part of a group working on refugee policies.

In 2017, Hecker was appointed director of the foreign, security and development policy division at the chancellery, where he became an adviser to Merkel, and would accompany the chancellor on her foreign trips, according to the embassy in Beijing on its official Weibo account.

Hecker was born in the northern German city of Kiel in 1967. He was married and had three children, his biography on the Foreign Ministry website shows.

He had appeared "happy and all right" when he hosted an event about German artist Joseph Beuys at his Beijing residence on Friday, a guest at the event said.

According to the embassy, when he started the role, Hecker said his main objectives for the new diplomatic mission were to "contribute to the stable and long-term development of Germany and China relations through our work."

Hecker, a legal scholar, worked as a judge with the Federal Administrative Court of Germany from 2011 to 2015. Prior to taking the role, he had been employed at the German Interior Ministry.

Germany is China's biggest trading partner in Europe. China is also Germany's biggest trading partner, superseding the U.S. since 2017. The volume of trade between Germany and China exceeded 100 billion U.S. dollars in 2008.