Prison staffing levels must be urgently reviewed after an explosive device "erupted" at HMP Cardiff, a Welsh assembly member has said.
The incident came to light after a whistleblower from the city centre prison raised concerns with Plaid Cymru AM Bethan Jenkins, saying they were so understaffed inmates could "take over" the prison in "less than 10 minutes" in a riot situation.
A spokesman from South Wales Police said nobody was injured when "a bottle containing an unknown liquid erupted and slid across the floor" on June 15.
Four men were arrested, three of whom remain under investigation while the fourth will not face further action, he added.
Miss Jenkins, AM for South Wales West and Plaid Cymru's shadow cabinet secretary for communities, said she was speaking to a prison officer about plans to build a new prison in Baglan, Port Talbot, which she is opposing, when he started to talk about problems at HMP Cardiff.
She said: "He said that there had been an incident involving an improvised explosive device made out of tea whiteners... That was very concerning to them as staff and I quote directly from what I was told, he said: 'They could take over in less than 10 minutes, that is how short-staffed we are and that has been very close to happening a few times recently'."
Miss Jenkins called on the UK Government to conduct an urgent review into prison staffing levels and security across the prison estate.
She said: "If this incident is happening and prison officers feel that unsafe and if prisoners get to the point where they think they should be doing this type of thing for whatever reason then we have to be concerned.
"I said to the source, now you have told me I don't think I can just sit on that information... I wouldn't want to sleep at night thinking that something in the future could go off and it could be successful in that attempt.
"I don't want to scaremonger, that's not my intention, and I will refute anybody who tries to say that. My intention is to draw attention to the fact that A, there is a severe problem with recruitment and understaffing and B, I believe the prisoners feel that they need to be heard and respected more and treated better."
Miss Jenkins said her sources also raised concerns about the "appalling" problems with the educational programmes at the prison.
She wrote to prisons minister Sam Gyimah to raise her concerns.
Responding in a letter dated July 20 and seen by the Press Association, he said he had been informed of the incident by the chief executive of HM Prisons and Probation Service, who asked for "a detailed account of the incident and actions taken to prevent any further incidents of this occurring".
"The Director of Public Sector Prisons in South Wales has reviewed the incident and the actions taken and is content that measures are in place to prevent a further re-occurrence," he wrote.
"The police arrested four men following the incident and are seeking to press charges against the individuals, it is not believed to be an act of terrorism."
Responding to Miss Jenkins's request for information about staffing levels at HMP Cardiff, Mr Gyimah said target staffing levels for operational support, and band 3 and 4 prison officers were 218 and that there were currently 18 vacancies.
Miss Jenkins added: "We know that there is a significant shortage of prison officers across the prison estate and that there is an ongoing problem - acknowledged by the Westminster Government - in terms of recruitment and retention of staff.
"The numbers speak for themselves and coupled with what's being relayed to me by prison staff in South Wales, it clearly warrants further action by the UK Government.
"Plaid Cymru is therefore calling on the UK Government conduct an urgent review into prison staffing levels and security across the prison estate."
She also called for powers over criminal justice and policing to be devolved to Wales "as soon as possible".
A Prison Service spokesman confirmed the incident took place and that no prisoners or staff were hurt.
They added: "The matter was referred to the police and it would be inappropriate to comment further at this stage."