Inspectors have demanded action over patients facing long waits on trolleys at Wrexham Maelor Hospital's A&E unit.
Healthcare Inspectorate Wales (HIW) said officials found some people waiting eight hours during an unannounced visit in August.
It wants Betsi Cadwaladr University Health Board (BCUHB) to make rapid improvements.
In a statement, it said some of HIW's recommendations had already been addressed.
"It was identified that patients who were waiting on trolleys in the corridor were not receiving appropriate and timely care," said HIW.
"We had to alert the nurse responsible for the patients in the emergency department corridor to a patient who was experiencing increased chest pain.
"During the inspection, we found that there were no pressure relieving mattresses available for any patients who were waiting on trolleys within the emergency department."
"We considered the above practices to be unsafe and increased the risk of harm to patients.
"This meant that we wrote to the health board immediately following the inspection requiring that urgent remedial actions were taken."
The health board said it had since set up a unit to ease pressure on the emergency department.
"The patient safety issues highlighted are unacceptable, and we have already made a number of immediate changes to provide reassurance about the quality and safety of care provided in Wrexham Maelor's emergency department," it said.
The hospital has also started making hourly announcements on waiting times within the emergency department.
However, a spokesman said there were still cases where people were visiting A&E with non-urgent conditions.
The health board has been under partial Welsh Government control since being placed in special measures in 2015, following a damning report.