Mohamed Bouderbala, 36, was found dead on December 29th in the Archidona prison in southern Spain, a new jail temporarily used as a so-called CIE, a centre where migrants are held pending asylum claims after they arrive in Spain, which has since been vacated.
An autopsy revealed he hanged himself with a sheet, but his brother Ahmed, who was in daily contact with him, has disputed the assertion that his brother was suicidal.
Speaking at a parliamentary commission, Interior Minister Juan Ignacio Zoido said Bouderbala and several other migrants started a riot on December 28th.
They "threw themselves to the ground and started self-harming with plastic cutlery they had just used in the dining room," he told lawmakers.
A riot ensued involving other migrants and Bouderbala was put into a room alone, as were other "instigators".
Around 18 hours later, he was found dead, according to a court document.
Zoido said Bouderbala had not been involved in any incidents before.
He also refuted claims that the use of the prison was illegal, saying Spanish law states that places similar to CIEs can be used in emergency situations where migrant detention centres are full.
That was precisely the situation from November 16 to 20, when close to 1,000 migrants from sub-Saharan Africa, Morocco and Algeria arrived in Spain on rickety boats, Zoido said.
According to the International Organization for Migration, migrant arrivals by sea to Spain more than doubled in 2017 on the previous year, with at least 21,600 people coming to shore. 223 people died on the way.
Zoido said it was very cold when Bouderbala and others arrived in Spain.
"The alternative which had been used in our country on other occasions was putting up tents in which there would not have been any heating," he said, adding the prison at least was heated and had other facilities such as sports equipment.
Earlier this month, authorities vacated Archidona, which will soon open as a fully-fledged jail.
Zoido said that of the 577 Algerian migrants who were held in the prison, 486 were sent back to their country.