BEIJING (Reuters) - German President Joachim Gauck told students in China on Wednesday that communist East Germany lacked legitimacy, as he denounced “dictatorship” and called for academic freedom.

German President Joachim Gauck (L) shakes hands with Chinese Premier Li Keqiang ahead of a meeting at the Great Hall of the People in Beijing, China, March 21, 2016. REUTERS/Wu Hong/Pool

China is in a midst of a renewed crackdown on civil society and the media by its ruling Communist Party.

Gauck, a former rights activist in East Germany, said his former country’s propaganda “glorified” it as the better of the two Germanies, according to an English transcript of his comments issued on his office’s website.

“But it wasn’t. It was a state that, as part of the union of Communist countries dependent on the Soviet Union, silenced its own people, locked them up and humiliated those who refused to comply with the will of the leaders,” he told students at Shanghai’s elite Tongji University.

Germany was split at the end of World War Two into a communist east and capitalist west. It was re-united in 1990, after the fall of he Berlin wall.

Gauck said most people in East Germany were “neither happy nor liberated” and the system lacked legitimacy. He referred to both the Nazi and communist periods as “brutal dictatorships”.

“Free, equal and secret public elections were not held. The result was a lack of credibility, which went hand in hand with a culture of distrust between the rulers and those they ruled.”

Gauck said he was also “concerned to hear some of the news that has been coming out of China’s civil society lately and in recent days”, though he did not give any examples.

Universities, he added, have “to be a place of unhampered research and free and frank discussion”.

Asked about his remarks, Chinese Foreign Ministry spokeswoman Hua Chunying said she had “not read in detail” his speech.

“We absolutely endorse that the social systems, traditions and culture in China and Germany are not exactly the same,” she told a daily news briefing.

As long as the two countries respect each other and deepen trust via dialogue, then relations could continue to be good, she said.

Gauck, whose position is largely ceremonial, is on an official visit to China, and has already met President Xi Jinping.

On Tuesday, the Global Times, an influential tabloid published by the Communist Party’s official People’s Daily, said in an editorial human rights were not a priority for his trip.

“Although having different values with the Chinese, Gauck clearly knows that he has to show respect to China despite the differences,” it said.

“He knows that unlike in the era of East Germany, China has its own diversity. The development of human rights in China is different from what the Western world portrays.”