THESSALONIKI, Greece — Several hundred refugees and migrants have gathered outside a police station in Greece's second largest city, waiting for hours to be formally arrested in order to gain temporary residence in the European Union country.

Families, including many from Syria, sat on the sidewalk outside the police building for hours Friday after crossing illegally from Turkey.

Police in northern Greece have reported a surge in illegal land crossings following Turkey's military offensive in northern Syria and capture of the town of Afrin from Kurdish fighters.

Among them was 24-year-old Mohammed Basil who fled Afrin with his wife and spent several days at a state-run hostel on the Greek-Turkish border before being allowed to leave and travel to Thessaloniki.

"We escaped from the war, and we have identification papers. Now we are waiting to be taken somewhere to stay," Basil told The Associated Press.

The huge line formed for a second day as many slept on the ground outside the police building or looked for a nearby park to rest. Although the arrest is considered a formality for refugees, many use the procedure as the fastest method to start their paperwork.

Most families are requesting placement at refugee camps around Greece that were set up after a European crackdown on migration two years ago. Refugees from Syria and other war-torn countries are usually granted the right to stay in Greece for at least 30 days.

Dimitris Beliakidis, a police spokesman, said there had been a spike in arrivals in the city over the last few days. They coincided with renewed tension in Syria over the possibility of Western military intervention.

New arrivals have mostly crossed the Evros River, which forms a natural border between Greece and Turkey, as migrants mostly try to avoid the Greek islands where strict controls on movement have been imposed and refugee camps are overcrowded.

Separately Friday, several thousand protesters gathered outside the U.S. Embassy in Athens in a rally against possible strikes in Syria. Organizers said protests are also planned on the island of Crete where a deep-water port at Souda Bay is used by the U.S. military.