An Italian mayor has dumped a pile of earth on a road leading to a residential building to prevent migrants and refugees coming into his community, Ansa news agency reported on Monday.

The blockade in the village of Vitulano in the southern region of Campania was removed shortly afterwards, Ansa reported.

Mayor Raffaele Scarinzi of the Social Democratic Party (PD) had staged the stunt after agreeing with the authorities to accommodate only 12 new refugees in the 3,000-strong community rather than the 34 they had been asked to take.

"We are not racists," Scarinzi said. "But we want the state to respect the rules." He demanded better conditions for the integration of refugees.

Migration is a sensitive subject that has to be met with humanity and solidarity, the provincial secretary of Scarinzi's party, Carmine Valentino, said in reaction to the protest.

The government would do all it could to support communities at "this difficult time," he said.