Officials in Fernie, B.C., say that the three people killed in an ammonia leak at a hockey arena were workers doing maintenance at the facility.

One of those workers was a contractor that worked for a Calgary refrigeration company who had only been at the site for a few hours before the fatal incident took place.

Emergency crews were called to the Fernie Memorial Arena on Tuesday after an ammonia leak was detected at the facility.

Officials say that when they arrived at the scene, a civilian was performing CPR on one of the workers. A subsequent search of the building by firefighters in protective gear discovered two more bodies.

"Fernie fire rescue responded to a medical assist call as a result of an ammonia leak. Firefighters arrived on scene and observed a civilian performing CPR on a person. Crews relocated the victim at that time and B.C. Ambulance service took over patient care," said Ted Ruiter, Fernie's fire chief.

The building and surrounding neighbourhood was quickly evacuated but three people died after being exposed to the deadly gas. Officials say two of them were city workers while another was a contractor.

Authorities have secured the scene at the arena and a hazardous materials team from CIMCO Refrigeration has been called to assist crews with the investigation.

"The chemical we are dealing with is called anhydrous ammonia," said Ruiter. "It's a product that is used commonly in arenas for refrigeration. We are doing a perimeter check of levels in the air."

Evacuees are staying with other family members in the community while about 25 others are being housed in hotels.

Mary Giuliano, Fernie’s mayor, says the community is heartbroken by the tragic event.

“We’ve suffered tragedies but we’re a pretty resilient town and I am really proud of our little town. We’re a tight knit community; we love one another and we’ll be there for one another. If it turns out that it is Fernie people, we will be there for the families.”

She said the community is respecting the family's wishes and will not be releasing the names of the victims.

Chris Inglis, who lives in Fernie, says it's been a tough time following the deaths.

"I knew two of them. Fernie and the Elk Valley is such a tight knit community. It just hits so close to home and it's really tough day for Fernie."

Inglis says that everyone in the community is feeling the impact all the way through the valley, in every community. He's seen a lot of condolences on social media, including on many of the Fernie community Facebook pages.

"Thoughts and prayers to all the victims and their families and their friends and their co-workers. It's overwhelming. It's been hard to hold your emotions back because of how much the town is suffering."

Inglis knew two of the victims but had a lot of great interactions with one in particular.

"Such a great guy. He worked at the arena for over 30 years so you could imagine all the interactions he had with the school kids, with the minor hockey system, the figure skaters, the Ghost Rivers junior hockey and the parents and all that. The guy was just a legend at the arena."

Sgt. Trevor Tribes with the Fernie RCMP says they are working with WorkSafe B.C. on the investigation. He saus the identities of the victims will not be released out of respect for their families.

"The next of kin have been advised. There will be no release of those victims' names at this time and, though I don't speak for the B.C. Coroner's Service, that may fall to them but they may not want to talk."

He says it is still very early in the investigation of the incident.

There is no word in when the displaced residents will be allowed back into the area, but it's unlikely that it will be anytime on Wednesday.

The state of emergency will remain in effect for a week unless it is cancelled earlier by officials.