Image copyright EPA Image caption The violence that has caused thousands to flee is the worst to hit the Kokang region since 2015

At least 20,000 people from Myanmar have fled across the border to China after violence erupted between ethnic rebels and the security forces.

Thousands entered border camps and are receiving humanitarian assistance, China's foreign ministry said.

Earlier this week, about 30 people were killed on Myanmar's border with China after rebels launched a surprise raid.

The violence is a blow to efforts by Myanmar's de facto leader, Aung San Suu Kyi, to end decades of conflict.

The latest clashes, which involved artillery and small-arms fire, took place in the town of Laukkai in the Kokang region in the northern part of Shan state.

Chinese foreign spokesman Geng Shuang said aid was being offered to those looking to "temporarily avoid the war", and called for an immediate ceasefire, adding that China supported Myanmar's peace process.

He said that all sides needed to find a peaceful solution through dialogue and urged restraint to "prevent further escalation" and "to restore peace and stability to the border areas".

Image copyright EPA Image caption Refugees fleeing the conflict at the China-Myanmar border receive water

On Monday, fighting erupted after the Myanmar Nationalities Democratic Alliance Army (MNDAA) launched a surprise raid while dressed in police uniforms, officials said.

The attack targeted police and military posts. A separate group of fighters later attacked other sites in Laukkai.

Five civilians, five police officers and at least 20 rebel fighters are said to have died.

This week's violence is among the worst to hit the Kokang region since 2015.

Kokang has close ties to China, with locals speaking a Chinese dialect and using the yuan as currency.

The worsening conflict in the borderlands has raised tensions between Myanmar and Beijing.

Ms Suu Kyi's government is desperate to end the decades-long violence, amid fears it could spark a major new refugee exodus.