The chief fire inspector for New Brunswick says he's had to regularly remind hospitals it is against the law to keep patients on gurneys in the hallways of their institutions.

Ken Harris says such a practice is against the national fire code and the building code.

"It is something that we keep trying to get through to the people who run these hospitals is that these corridors are meant for the safe exiting of patients," Harris told CBC News. "They're not intended for the use of storage of beds, stretchers, whatever type of equipment they have."

Many patients across the province, including New Brunswick Health Minister Michael Murphy, have recently had to spend the night in a hospital corridor because of a lack of beds.

Murphy said he was treated in the hallway at the Dr. Everett Chalmers Hospital in Fredericton two weeks ago when he was suffering from severe dehydration. He called the situation "very unfortunate" but insisted the patients are being well cared for.

The health minister's comments came last week after he was questioned about the case of Jason Steeves, a Moncton man who says he and four other patients were recently stuck in a hallway overnight waiting for care at the Moncton Hospital even as other beds were left empty.

Harris said Moncton's fire department is in charge of making sure the corridors are safe at the hospital.

The local fire inspector said there's an annual inspection of the Moncton Hospital and he's never seen any beds in the hallways.

Nancy Savage, Moncton Hospital's vice-president of clinical services, told CBC News she's not aware of any violations of the fire code.

She said the hospital is more than willing to work with the fire inspectors to make sure patients are safe.