A grand gesture by Madrid to accept migrants rejected by Italy and Malta has backfired on some Spanish students, who were told to leave their dormitories in 24 hours to make room for the new arrivals.

Pedro Sanchez, Spain’s newly appointed prime minister, agreed to take in passengers of the rescue ship Aquarius, who are mostly from sub-Saharan Africa, after Italy’s anti-immigration government and Malta blocked the ship from docking. But the arrival of the ship brought chaos into the lives of Spanish students in the city of Alicante, who were told to leave their dormitory to make room for the refugees.

The La Florida dormitory was chosen by the regional government of Valencia to host around a hundred unaccompanied children from the Aquarius. The children, aged between 12 and 17, were brought to the city by buses after the ship and two Italian vessels, which helped transport the refugees, arrived in Spain on Sunday.

The students, who reportedly pay as much as 750 euros per month for the accommodations, were told to vacate the rooms within 24 hours. The authorities explained that the eviction was necessary due to an emergency situation caused by the arrival of the migrants, reported the news portal Intereconomia. The mother of one of the students told the network that her son was told that all students had to leave La Florida because the migrant children were likely to have “many diseases” and posed a health risk.

The sudden development was reportedly not welcomed by many of those affected.

“We’re not against helping those in need, but it isn’t fair for my son to be removed from his residence and left on the street in the middle of his studies,” the woman said, adding that her son needed to complete his course in German in order to qualify for a new job in that country.

The regional government told RT it will ensure that all displaced students are provided new accommodations and that the province would cover their expenses.

The Aquarius came into the media spotlight earlier this month when it rescued almost 630 people trying to reach Europe from Libya in makeshift boats. Italy denied the vessel from docking at any of its ports, as the country’s new anti-establishment coalition government took a stance against accepting more migrants. The Italian Navy provided two ships to redistribute the refugees for safer travel. Italy also urged Malta to accept the migrants, but the island state also refused.

Sanchez, who became the prime minister of Spain in early June, said that it was “our duty to help avoid a humanitarian catastrophe and offer a safe port to these people” and invited the ships in. Some 2,300 people, including volunteers, translators, police officers and health officials were responding to the arrival, but apparently the operation was not as smooth as the Spanish government would hope it would be.