Over 100 migrants, brandishing placards declaring "We need to pass" and "We need freedom", started their sit-in in the town of Vintimille on Friday.
On Saturday a dozen gendarmes were present to stop them entering France, although the border remained open to other traffic.
The men in the group responded by refusing food provided by the Red Cross, although the women and children continued to eat.
Most of them reportedly come from Eritrea, Somalia and Côte d'Ivoire and crossed the Mediterranean from Libya, arriving in Europe on the Italian island of Sicily and making their way north in the hope of going to France, Sweden or the United Kingdom.
"I am applying the rules of the game in the European Union," French Prefect Adolphe Colrat, who ordered the police to the frontier, said on Friday. "People without papers must be readmitted to the country they came from, in this case Italy."
Colrat tightened control of migrants at the station in Nice, the French city 40km from the Italian border, in May.
A record 1,439 undocumented immigrants have been detained by police in the last seven days, according to Colrat, and 1,097 have been sent back to Italy.
With the deaths of migrants at sea drawing international attention to the flow of people fleeing conflict and poverty in Africa and the Middle East, Italy and other Mediterranean countries have appealed to northern Europe to accept more migrants.