A Greek government-chartered ferry was transporting some 2,600 Syrian refugees to the Greek mainland on Wednesday, as islands struggling with an influx of migrants warned that the crisis is endangering public health.

The Eleftherios Venizelos left the island of Kos with some 1,700 Syrian refugees on board, and picked up another 900 on the islands of Kalymnos, Leros and Lesbos.

It had initially been scheduled to sail to the northern port city of Thessaloniki on Thursday morning.

But it was diverted to Piraeus, the port of Greek capital of Athens, where it was expected at 0545 GMT Thursday, the Greek news agency ANA said.

Migrants put pressure on Greek islands P.Mouche/V.Lefai, AFP

It said the decision was taken following a meeting with various authorities, including those in Thessaloniki who felt the city could not cope with that many refugees at one time.

Buses had already been rented in Thessaloniki to take the refugees to the border with Macedonia.

"The situation is out of control," Leros mayor Michalis Kolias said in a letter to the government, asking for help in getting hundreds of migrants off the island.

"The lives of irregular migrants and of the island's residents and visitors are in danger," Kolias said, pointing to health risks from overcrowding.

Macedonia also warned Wednesday it was running out of trains to transport the thousands of Syrian refugees heading toward the EU, and said it has urged its neighbours to help combat the "alarming situation".

"The Macedonian Railway Company has no more capacity to carry all those who want to travel toward western European countries," the head of the state railway Nikola Kostov told Telma television channel.

A migrant looks at the passenger ship "Eleftherios Venizelos" leaving the port of the Greek island of Kos on August 19, 2015 Angelos Tzortzinis, AFP

A record 107,500 migrants arrived at the European Union's borders last month, according to new figures released by border agency Frontex, a dramatic increase that is creating a humanitarian crisis for the 28-nation bloc.

Greece has seen around 160,000 migrants -- virtually all of them fleeing war and persecution in Syria, Afghanistan and Iraq -- land on its shores since January, according to the UN refugee agency.

The Greek Aegean islands close to Turkey have borne the brunt of the influx, with authorities overwhelmed and rights groups criticising miserable conditions facing the migrants, who are often forced to sleep in the open for weeks and queue for days to secure departure papers.

The government has announced plans to charter a second ship to move as many migrants as possible to the mainland, but with the tourism season in full-swing there are no large vessels to spare, the association of ferry operators said Wednesday.

Syrian refugees stand aboard the Eleftherios Venizelos liner which will serve for their registration and as housing facility for some migrants in the port of Kos on August 18, 2015 Louisa Gouliamaki, AFP

"There are no ferries available at present (and) next week there will be a problem as the ferries will be at near 100 percent capacity," association chairman Michalis Sakellis told Vima radio.

Greece is giving Syrian refugees priority in registration and embarkation for the mainland, over other nationalities such as Afghans and Pakistanis.

On Lesbos, scuffles have routinely broken out between non-Syrian migrants stuck on the island, and an aid group on Tuesday warned the situation was reaching "breaking point".

"Unless further ships are made available the total number of refugees on Lesbos, which normally has a population of nearly 90,000 people, could rise to more than 20,000 before the ferry service is able to accommodate them," the International Rescue Committee (IRC) said.

The small islands of Symi and Agathonisi, where there are more migrants than locals, also called on the government for assistance on Wednesday.

"I hope no more migrants come because the available space at the coastguard and police buildings is already taken by others," Symi mayor Lefteris Papakalodoukas told state television.