First Minister Nicola Sturgeon has said she had no role in a legal bid aimed at preventing a newspaper from publishing a story about a prisoner's death.
Allan Marshall was restrained by guards at HMP Edinburgh and suffered a cardiac arrest during a lengthy struggle with staff.
He was dragged face down and feet first by prison officers.
A sheriff later ruled his death in March 2015 was "entirely preventable", saying there were "instances when better training of Scottish Prison Service staff could have made the difference".
Lawyers went to court in the middle of the night in a bid to prevent details of the case being published last month but the First Minister told MSPs she had played no part in this.
"This was a decision by the Scottish Prison Service to initiate court action," Ms Sturgeon said.
"The Scottish Prison Service later decided not to proceed with that action and I think that was the right decision."
Scottish Labour leader Richard Leonard, who challenged her on the case at First Minister's Questions, accused her Government of "heavy-handed interference in the freedom of the press".
He raised the issue as members of Mr Marshall's family looked on from Holyrood's public gallery.
The Scottish Labour leader claimed ministers "went to court in the middle of the night seeking an interdict" to prevent the story from being published.
He told the First Minister: "Let's be clear, Allan Marhsall died following a shocking incident in prison service custody, the sheriff says his death was 'entirely preventable' and your Government goes to court in the dead of night to keep this out of the public eye."
Mr Leonard then demanded: "Does the First Minister regret this heavy-handed interference in the freedom of the press, will she apologise to members of Allan Marshall's family, who are in the public gallery of the Parliament today, and will the First Minister agree to a full independent investigation into her government's actions, including how much money was wasted, the role of the Justice Secretary and indeed her own role in this?"
Ms Sturgeon, who confirmed she had watched CCTV footage of Mr Marshall being restrained, stressed she "had no role" in the legal proceedings.
She said any lessons that could be learned from the case would be, as she offered her condolences to the dead man's family for their "grief and anguish".
The First Minister said: "I take matters like this extremely seriously because I take very seriously the responsibilities of the state when individuals are in custody, their human rights continue to require to be protected and respected, so therefore in situations like this if there are lessons to be learned it is vital they are learned."
The Scottish Prison Service is currently considering 13 recommendations made after a fatal accident inquiry into the death, with Ms Sturgeon saying Holyrood committees could also probe what happened.