A public inquiry will be held into the death of Sheku Bayoh, the justice secretary has confirmed.
Mr Bayoh, 32, died in 2015 after being restrained by police officers responding to a call in Kirkcaldy, Fife.
It was announced on Monday that no officers would face prosecution over the death, leading to the family of Mr Bayoh saying they felt "betrayed" by the decision.
Humza Yousaf has now told MSPs that a public inquiry will take place.
The inquiry will look to establish the role Mr Bayoh's race may have played in his death, Mr Yousaf said.
Deaths in police custody in Scotland are subject to a mandatory fatal accident inquiry (FAI).
Mr Yousaf told Holyrood that Scotland's Lord Advocate felt an FAI "would not allow all the issues which require to be investigated to be addressed".
Mr Yousaf said: "It is imperative that the circumstances leading up to Mr Bayoh's death and the events that followed are examined in full and in public."
He and the First Minister, met relatives in the Scottish Parliament on Tuesday before the announcement of the inquiry was made.
The Justice Secretary told the chamber: "Let me finish by expressing my condolences once again to Mr Bayoh's family and friends, who have been unwavering in their search for answers.
"I am confident that a statutory public inquiry under the 2005 Act will provide the best means of establishing the circumstances leading to and following Mr Bayoh's tragic death."
He added: "For any independent scrutiny of this case to be rigorous and credible, it must address the question of whether or not Mr Bayoh's race played a part in how the incident was approached and dealt with by the police.
"In saying that, I am not pre-judging the answer to that question - that will be for the inquiry, which will be independence of ministers.
"In order to do this effectively, the inquiry must be equipped with the necessary diversity of expertise and background to scrutinise the extent to which race was a factor in this case."
Mr Bayoh's sister said the family were determined to "achieve justice".
Kadi Johnson said: "The last four-and-a-half years hasn't been easy for us. We want this inquiry to mean something and Sheku's death not to have been in vain.
"His name has been tarnished in the past four years. This is about achieving justice for Sheku and for a fairer Scotland for all irrespective of race and background."
Family lawyer Aamer Anwar said: "To say that a public inquiry must leave no stone unturned is an essential starting point.
"There must be publicly accountable learning.
"As with events like Hillsborough or the inquiries into the killing of Stephen Lawrence, Zahid Mubarek or Hillsborough it is necessary in terms of public confidence and justice going forward for the various chapters of the inquiry to cover both the cause and the wider circumstances that contributed to the death and what recommendations can be made to avoid repetition and the safeguarding of lives in the future.
"From that, it follows that the inquiry must identify each and every individual and organisation who must bear responsibility and accountability for this tragedy and the mishandling of the aftermath."