China's embassy in Ottawa told Canada on Sunday to stop meddling in Hong Kong affairs a day after the country issued a joint statement with the European Union in defence of the "fundamental right of assembly" for Hong Kong citizens.

Hundreds of thousands of anti-government protesters rallied peacefully in Hong Kong on Sunday in the 11th week of what have been often violent demonstrations in the Asian financial hub.

On the eve of Sunday's rally, Canadian Foreign Minister Chrystia Freeland and EU foreign policy chief Federica Mogherini said in a statement: "Fundamental freedoms, including the right of peaceful assembly ... must continue to be upheld."

"It is crucial that restraint be exercised, violence rejected and urgent steps taken to de-escalate the situation," the pair wrote. The statement did not explicitly assign blame to either the government or the protesters.

"Engagement in a process of broad-based and inclusive dialogue, involving all key stakeholders, is essential," the statement said, noting that both Canada and the EU support Hong Kong's "high degree of autonomy" within China, as well as its residents' right to peaceful assembly.

The Chinese Embassy said in a statement on its website that Canada should "immediately stop meddling in Hong Kong affairs and China's internal affairs."

Hundreds of thousands of anti-government protesters rallied peacefully in Hong Kong on Sunday in the 11th week of what have been often violent demonstrations in the Asian financial hub. (Kim Hong-ji/Reuters)

"Under the current situation, the Canadian side should be cautious on its words and deeds regarding the Hong Kong related issue," the statement from an unnamed spokesperson for the Chinese Embassy in Canada said.

"The relevant protests and demonstrations in Hong Kong have already deteriorated and evolved into extreme violence. In face of such severe violence and offences, no government with a sense of responsibility would sit idly by," the statement said.

Canada's foreign ministry had no immediate response. Canada has about 300,000 citizens living in Hong Kong, the ministry has said.

Canada has been caught up in a diplomatic dispute with China since Canada's detention of Huawei Technologies Co Ltd Chief Financial Officer Meng Wanzhou on a U.S. warrant in December.

Shortly after Meng's arrest in Vancouver, China detained two Canadian men, who have yet to be released. China has also blocked imports of some Canadian commodities.