Albania's constitutional court has approved a controversial agreement to send asylum seekers in Italy to Albania.
Under the agreement, the Italian government will build two centres in northern Albania to process36,000 people hoping to reach Italy each year.
The deal will now have to be ratified by the Albanian parliament.
However, it is likely to pass easily as Prime Minister Edi Rama holds an unassailable majority.
Under the agreement, some 3,000 people a month who attempt to reach Italy by sea would be detained in two processing centres near the Albanian north-eastern port of Shengjin while their asylum claims are examined.
The centres would be paid for by the Italian government and would be operated under Italian law. Italian staff would be responsible for operations and would have immunity from Albanian law in certain cases.
Once migrants' asylum claims had been assessed, Italy would be responsible for either resettling them from the centres to Italy or deporting them. Security personnel and police officers will be provided by Albania.
Italian Prime Minister Giorgia Meloni and Mr Rama first presented the deal in Rome in November.
Soon after, the agreement was temporarily blocked after the Albanian opposition filed two petitions arguing that the agreement would deny the asylum seekers the protection of the constitution and international law.
But on Monday, constitutional court judges ruled that the agreement was not unconstitutional. They said that the deal "does not create new constitutional rights and freedoms, nor does it bring additional restrictions on existing human rights and freedoms, beyond those provided by the Albanian legal order".
Judges also rejected claims that the deal to set up asylum reception facilities would give Italy sovereignty on Albanian territory, ruling that the agreement "does not set territorial borders nor does it change the territorial integrity of the Republic of Albania".
Albanian media reported that the court's judges voted 5-4 to reject the application to block the proposed legislation.
Last week, Italian MPs voted in favour of the agreement, which was backed by 155 votes to 115. It will now go to the Italian Senate, where it is also expected to be approved.
United Nations High Commissioner for Human Rights, Volker Turk, told the Italian Senate last week that he was concerned that transfers of asylum seekers to Albania would "raise important human rights issues" including living conditions and freedom for arbitrary detention.
It is unclear when the centres might open, but spring 2024 was the tentative date given for when the plan was first announced.
Ms Meloni, who heads the right-wing, nationalist Brothers of Italy party, promised to crack down on immigration when she was elected in September 2022.
However, more than 155,000 migrants entered Italy in 2023 - 52,000 more than the previous year.
The Albania plan is one of Ms Meloni's proposed interventions to end illegal immigration.