Tourists visit the historic Reichstag building, which houses the German parliament, in Berlin, in this 2013 file photo. [Photo/VCG]

The Chinese embassy in Berlin has warned Chinese to respect local laws after two tourists were arrested on Aug 5 in the German capital on a charge of making the Nazi gesture while taking photos outside the German parliament.

The unidentified men, aged 36 and 49, were hauled off to a Berlin police station when officers assigned to guard the historic site caught their "illegal act". They could face a fine or a prison sentence of up to three years under post-1945 laws, according to the local police.

German law forbids the use of symbols affiliated with banned organizations in public, such as flags, uniforms and gestures, including those linked to Hilter and the Nazis.

The investigation authorities in Germany have launched criminal proceedings against the duo for breaking the law.

But the Chinese pair claimed the gesture was meant as a joke. They were told they could leave the country after handing over a fine, and the bail money could be used to cover it, a German police spokeswoman was reported as saying.

They were released on bail of 500 euros ($600) each, and the Chinese embassy in Berlin confirmed on Sunday that the pair left Germany to continue their trip.

"(Chinese tourists) should prepare themselves before traveling abroad. They should not only travel safely but also respect local traditions, customs and laws at all times. They should ensure their words and deeds do not cause offend," Zhou Anping, director of the Chinese embassy's consular section, told China News Service.

A screenshot from Telegraph shows Giorgos Katidis making the Nazi gesture.

The case has attracted wide concern and debate among the netizens.

"Ignorance of the law is no excuse for breaking it," wrote a Chinese weibo user, citing Greek soccer player Giorgos Katidis' life ban as an example.

In 2013, the 20-year-old AEK Athens midfielder was banned for life from playing for the national team by Greece's football federation after he celebrated a goal with a Nazi salute.

"There were no warning signs nearby, so the pair was not at fault," claimed another user.

Citizens from some European countries, like Germany and Austria, have been schooled in strict anti-hate laws, which prohibit pro-Nazi symbols and speech.