The European Court of Human Rights (ECHR) has told Malta to pay thousands of euros in compensation to two African migrants whose rights were violated.
A Somali woman who had a miscarriage during her detention in 2011 is to receive 30,000 euros (£26,000; $40,000), plus 3,000 euros in costs.
A man alleged to be from Sierra Leone is to receive 27,000 euros in total.
The court said the woman's prison conditions were "degrading". Malta is a target for boatloads of migrants.
Earlier this month Malta cancelled flights it had booked to return migrants to Libya, after an emergency intervention by the ECHR.
The court in Strasbourg issued rulings on Tuesday concerning Aslya Aden Ahmed, a Somali national, and Ibrahim Suso Musa, allegedly from Sierra Leone.
In Ms Ahmed's case, it is the first time the court has ruled against Malta for violation of Article Three of the European Convention on Human Rights - prohibition of inhuman or degrading treatment - concerning migrant detention conditions.
The judges criticised conditions at Lyster Barracks - the holding centre - where migrants were exposed to cold, a lack of female staff, lack of access to open air, denial of exercise for long periods and poor food.
Ms Ahmed entered Malta illegally by boat in February 2009, and in May that year her application for asylum was rejected.
She later escaped from detention, got to the Netherlands, but was sent back to Malta in February 2011. She was then imprisoned for six months, but had become pregnant and miscarried in hospital in March 2011. She still lives in Hal Far, in Malta.
The court also found that her detention for 14 and a half months had been illegal, because the Maltese authorities had not taken any steps to deport her and had not reviewed the terms of her detention.
In the case of Mr Suso Musa, the court found that his detention had been arbitrary and the authorities had taken an unreasonable length of time to decide whether to let him stay in Malta. He entered Malta illegally by boat in April 2011 and remained in detention until March 2013.
Earlier this month Malta's Prime Minister Joseph Muscat said more than 400 migrants had arrived in the past week. As an EU member state it called for assistance from its EU partners to tackle the influx.
The summer months often see a stream of boats carrying migrants from Africa. Many arrive in Malta or at the Italian island of Lampedusa, hoping to gain access to other parts of the European Union.