It's not clear yet how many migrants Spain will be taking in.
Spain has said they will take some of the 150 migrants on a rescue ship that has been blocked from docking in Italy, authorities in Rome said on Thursday.
The ship was in Italian territorial waters on Thursday, said a spokeswoman for the Spanish charity Open Arms.
Open Arms had been stranded for 13 days with around 150 migrants on board near the Italian island of Lampedusa. The Open Arms confirmed the news on their Twitter page.
On Wednesday, an Italian administrative court lifted the ban on entry into Italian territorial waters imposed on the Open Arms to "allow the relief of people on board".
This decision comes after an Italian justice court suspended the ruling signed by Interior Minister Matteo Salvini.
Italian Prime Minister Giuseppe Conte's office said on Thursday that Spain had expressed willingness to take some of the migrants once they disembarked.
The Spanish government declined to comment publicly but the Spanish newspaper El Pais also confirmed the information, reported Reuters.
There isn't any information regarding the number of migrants the Spanish government would take in but under a broader deal, France, Germany, and others would also take part.
The Open Arms spokeswoman said the ship was anchored 8 kilometres off Lampedusa.
The ship will now wait for confirmation of a safe docking point.