Officers in riot gear pushed the migrants back towards the town of Ventimiglia, five kilometres from the border.
But a group of about 50 men managed to take refuge on rocks near the border post.
"Where are our human rights?" some of the men shouted, claiming they had been treated roughly by the police.
An Italian official said the protesters would be taken by bus to reception centres in the western province of Imperia.
But on Sunday a local police officer said that about 150 of them had spent the night at the local station.
Some of them, mostly men, had earlier declared a hunger strike to demand the right to enter France.