CALGARY - Calgary's mayor says Canadian Pacific Railway has apologized for the chaos caused by a train that derailed after a bridge over the swollen Bow River failed Thursday.

Emergency crews were working to pump all of the oil products off six tanker cars that were teetering on the broken bridge, a process that was expected to take until Friday.

Naheed Nenshi initially lashed out at the railway, saying he had concerns about the timing of the bridge inspection in relation to flooding that swamped the city. He also wondered why railways are exempt from municipal regulations.

Railways are under federal jurisdiction and are responsible for their own inspections.

"How is it we don't have regulatory authority over this, but it's my guys down there risking their lives to fix it?" Nenshi asked.

"Certainly once this crisis is over, I'll be looking for a lot of answers from a lot of people."

But by afternoon, after a conversation with CP (TSX:CP) CEO Hunter Harrison, the mayor softened his stance.

"He extended an apology to the citizens of Calgary for what has happened here," Nenshi said. "We both agreed, No. 1, our primary responsibility is to get this thing cleaned up and, No. 2, that we will work together much more and he reiterated safety in every community CP Rail runs through is a primary responsibility.

"I was happy to hear that commitment and now we'll see how well we're able to fix this problem."

CP (TSX:CP) issued a statement Thursday morning that said the bridge had been inspected on Saturday and the tracks on Monday. However, Harrison later told reporters the bridge was inspected five times after floodwaters rose. And CP engineers at the scene said the bridge had actually been inspected 18 times since flooding began.

Harrison said it was "clearly" a failure of piers at the bottom of the river. The engineers blamed it on fast water scouring away gravel under the support.

"We couldn't have seen anything from an inspection on top unless there was severe movement as a result of the failure down below," Harrison said. "We would normally have probably put divers in to inspect, but the current was too fast. Somebody would have drowned if they had tried to go in there, plus the current was so fast, and it's so murky, you couldn't do an appropriate inspection."

The rail company didn't anticipate "a problem like this occurring at all," said Harrison, who said it would have been "jeopardizing commerce" to hold back trains until divers could get in.

He also said the bridge's failure was as "extraordinary" as the heavy rains and flooding in southern Alberta. The bridge was built in 1912 and hasn't had a failure like this since 1944, he noted.

Nenshi wondered if recent layoffs at CP had anything to do with the situation.

"I'll be very blunt. I'll probably get in trouble for saying this," Nenshi said. "We've seen a lot of people lose their jobs at CP over the last year. How many bridge inspectors did they fire?"

The company, however, said the number of bridge inspectors remained the same.

The derailed cars were carrying a product used to dilute raw oilsands bitumen. The product is also used as a solvent used in metal polishes, paint thinner, oil-based stains and paint.

Jeff Gaulin of Tervita Corp., the derailment emergency response experts brought into handle the situation, said late Thursday that four cars still needed to be pumped out, one had been cleared and one was empty from the get-go.

"Once that's done, we'll have a crane on site ... when we will actually be lifting off the trains by crane off the tracks, putting them on land and putting them on transport to move them offsite."

Gaulin estimated the cars would be drained by Friday morning and that removal of the wreckage would take a couple of days.

"We're very confident they can be taken care of without leakage and they can be removed safely," he said. "We've been quite fortunate that ... the situation was stabilized quite quickly. There was minimal risk either of leakage or of collapse, but we've been on site prepared for just about anything."

Acting Calgary fire chief Ken Uzeloc said crews had strung a cable through the railcars and secured it to another train carrying rocks so that if the bridge gave way, the cars wouldn't be carried down the river.

Bruce Burrell, Calgary's emergency management director, said booms were placed down river in case of any spills.

The primarily industrial area around the derailment was evacuated, including the city's sewage treatment plant. Nenshi said staff had to leave because of the evacuation and there was no one left to treat the raw waste water now flowing through the plant. He said the city's water supply was safe, though. A major highway, Deerfoot trail, was also shut down for much of the day.

Federal NDP transport critic Olivia Chow said the federal government has to stop allowing rail companies to conduct their own inspections.

"They can do their own inspections, but the federal government — or some level of government — need to inspect bridges," she said.

"Mayor Nenshi is absolutely correct. He was being very polite, but it's the municipal government's personnel whose lives are on the line and yet they have absolutely no say whether these bridges are safe or not."

In 2008, two separate advisory panels made 70 rail safety recommendations. A House of Commons standing committee expressed serious reservations about the so-called Safety Management System, under which much of the responsibility for safety was devolved to rail companies.

The committee made several recommendations to modify the system and legislation was eventually passed.

But Chow said not enough has been done.

"There are fewer inspectors today than there were a few years ago."

Chow said $3 million was cut from rail safety in the most recent budget, which followed a $500,000 cut the previous year.

In an emailed statement, Transport Minister Denis Lebel said the department is responding.

"The Transportation Safety Board of Canada is onsite to conduct a full investigation to determine the cause of the accident," he said. "A Transport Canada ministerial observer will be present to report back on the investigation’s progress.

"Transport Canada is increasing oversight in southern Alberta as a prudent and precautionary measure."

Transportation Safety Board investigator James Carmichael said CP will be asked about its protocol for inspecting lines after floods.

"All the bridges, track, railcars, locomotives — they all are required by Transport Canada to be inspected regularly and I don't have all the time frames on all the stuff with me at the moment," he said. "We are going to gather all the records from all the inspections that have recently taken place.

"We're here to find out what happened and why and how to prevent it from happening again — or at least mitigating any circumstances where it could happen again."

Alberta Transportation Minister Ric McIver said discussions around rail jurisdiction and CP inspections were for another day.

"I feel very confident that the infrastructure that we have in place is, generally speaking, in very good shape," he said.

null

Related on HuffPost:

Loading Slideshow...
  • Crews work at the scene of a rail bridge collapse and railcars derailment over the Bow River, southeast of downtown Calgary, Alberta on Thursday, June 27, 2013.

  • Crews work at the scene of a rail bridge collapse and railcars derailment over the Bow River, southeast of downtown Calgary, Alberta on Thursday, June 27, 2013.

  • Crews work at the scene of a rail bridge collapse and railcars derailment over the Bow River, southeast of downtown Calgary, Alberta on Thursday, June 27, 2013.

  • Crews work at the scene of a rail bridge collapse and railcars derailment (centre, bottom) over the Bow River, southeast of downtown Calgary, Alberta on Thursday, June 27, 2013.

  • A close-up photo of the derailment.

  • A inspector examines a Canadian Pacific freight train as it sits derailed on a failing bridge over the Bow River in Calgary, Alta., Thursday, June 27, 2013. THE CANADIAN PRESS/Jeff McIntosh

  • A close-up screen grab of the derailment

  • A close-up screen grab of the derailment

  • A inspector examines a Canadian Pacific freight train as it sits derailed on a failing bridge over the Bow River in Calgary, Alta., Thursday, June 27, 2013. THE CANADIAN PRESS/Jeff McIntosh

  • A inspector examines a Canadian Pacific freight train as it sits derailed on a failing bridge over the Bow River in Calgary, Alta., Thursday, June 27, 2013.

  • MORE FLOOD PHOTOS FROM AROUND SOUTHERN ALBERTA

  • RCMP at the road block on the highway outside of Canmore, Alta.

  • Streets remain submerged in High River, Alta.

  • High levels of water continue to make conditions dangerous in High River.

  • Dark and murky water hides many hazards on the streets of High River, Alta.

  • Pet alley at Blackie for residents to sleep with pets.

  • Canmore, Alberta on Saturday June 22.

  • RCMP and numerous truckers rescued by helicopter as flood waters washed out the Hwy 1 near Canmore, Alberta.

  • Hugs for displaced people at the Blackie Evacuation Centre.

  • Flooded streets in southern Alberta community.

  • Emergency workers in High River, Alberta.

  • Road Block in High River, Alberta

  • Houses in some areas of High River, Alta. are still severely flooded.

  • Roadways unsafe as flood waters scatter debris and damage streets in High River, Alberta.

  • RCMP Helicopter at High River, Alberta.

  • Advising drivers in High River, Alberta

  • Flooded streets in High River, Alberta

  • Damaged roads in High River, Alberta

  • RCMP in High River, Alberta

  • More photos of the Alberta flood

  • Monica West carries damaged goods out of a souvenir shop as clean-up crews work at the Calgary Zoo in Calgary, Alberta, Canada on Tuesday, June 25, 2013. Heavy rains caused flooding, closed roads, and forced evacuations across Southern Alberta. Calgary Zoo staff risked their lives over the weekend to stop a hippo from escaping into the swollen Bow River. Director of animal care, conservation and research, Jake Veasey, says flood waters in the hippos' enclosure rose high enough during the floods for the dangerous herbivores to swim out. One hippo named Lobi was feeling particularly adventurous and was moving freely around the African Savannah building. Veasey had to break a window to get into the building and he swam in the muddy flood waters to find the animal. Zoo staff used cinder blocks and construction equipment to block Lobi inside the building. (AP Photo/The Canadian Press, Jeff McIntosh)

  • A muddied research book dries as clean-up crews work at the Calgary Zoo in Calgary, Alberta, Canada on Tuesday, June 25, 2013. Heavy rains caused flooding, closed roads, and forced evacuations across Southern Alberta. Calgary Zoo staff risked their lives over the weekend to stop a hippo from escaping into the swollen Bow River. Director of animal care, conservation and research, Jake Veasey, says flood waters in the hippos' enclosure rose high enough during the floods for the dangerous herbivores to swim out. One hippo named Lobi was feeling particularly adventurous and was moving freely around the African Savannah building. Veasey had to break a window to get into the building and he swam in the muddy flood waters to find the animal. Zoo staff used cinder blocks and construction equipment to block Lobi inside the building. (AP Photo/The Canadian Press, Jeff McIntosh)

  • A soldier walks by a pile of speedboats in High River, Alberta on Tuesday, June 25, 2013. High River was hit by a devastating flood on June 20 which caused a mass evacuation of the entire town although some residents chose to defy the order. Alberta's premier pledged $1 billion on Monday to help people recover from the floods. (AP Photo/The Canadian Press, Jordan Verlage)

  • Clean-up crews work at the Calgary Zoo in Calgary, Alberta, Canada on Tuesday, June 25, 2013. Heavy rains caused flooding, closed roads, and forced evacuations across Southern Alberta. Calgary Zoo staff risked their lives over the weekend to stop a hippo from escaping into the swollen Bow River. Director of animal care, conservation and research, Jake Veasey, says flood waters in the hippos' enclosure rose high enough during the floods for the dangerous herbivores to swim out. One hippo named Lobi was feeling particularly adventurous and was moving freely around the African Savannah building. Veasey had to break a window to get into the building and he swam in the muddy flood waters to find the animal. Zoo staff used cinder blocks and construction equipment to block Lobi inside the building. (AP Photo/The Canadian Press, Jeff McIntosh)

  • Wreckage lies along Center Street in High River, Alberta on Tuesday, June 25, 2013. High River was hit by a devastating flood on June 20 which caused a mass evacuation of the entire town although some residents chose to defy the order. Alberta's premier pledged $1 billion on Monday to help people recover from the floods. (AP Photo/The Canadian Press, Jordan Verlage)

  • A road crew foreman surveys the washed-out lanes of northbound MacLeod Trail in Calgary, Alta., Monday, June 24, 2013. Heavy rains caused flooding, closed roads, and forced evacuations across Southern Alberta. (AP Photo/The Canadian Press, Jeff McIntosh)

  • Thaya Gallant

    Thaya Gallant helps with the flood clean-up at a law office in Calgary, Alta., Monday, June 24, 2013. Heavy rains caused flooding, closed roads, and forced evacuations across Southern Alberta. (AP Photo/The Canadian Press, Jeff McIntosh)

  • Calgary firefighters check on home as residents and volunteers are in clean up mode in the community of Bowness as most of the homes have been pumped out with still some remaining submerged in water in Calgary, Alberta on Monday, June 24, 2013. Alberta's premier pledged $1 billion on Monday to help people recover from floods that devastated parts of the western Canadian province. (AP Photo/The Canadian Press, Nathan Denette)

  • People watch as the river peaks, causing flooding in Medicine hat, Alta., on Monday, June 24, 2013. Officials in Medicine Hat said Monday they believe water levels on the South Saskatchewan River have peaked and that flooding won't be as severe as initially feared. Roughly 10,000 people were evacuated as the city of 60,000 prepared for the surge of water that swamped Calgary and surrounding areas last week. (AP Photo/The Canadian Press, Nathan Denette)

  • Residents and volunteers are in clean up mode in the community of Bowness as most of the homes have been pumped out with still some remaining submerged in water in Calgary, Alberta on Monday, June 24, 2013. Alberta's premier pledged $1 billion on Monday to help people recover from floods that devastated parts of the western Canadian province. (AP Photo/The Canadian Press, Nathan Denette)

  • Lisa Nguyen

    Resident Lisa Nguyen, right, cleans of the mud from photographs and negatives as volunteer Jacinta Babbitt, left, shows a clean picture of Nguyen when she was younger during flood clean up in the community of Bowness in Calgary, Alberta on Monday, June 24, 2013. Alberta's premier pledged $1 billion on Monday to help people recover from floods that devastated parts of the western Canadian province. (AP Photo/The Canadian Press, Nathan Denette)

  • Residents and volunteers are in flood clean up mode in the community of Bowness in Calgary, Alberta on Monday, June 24, 2013. Alberta's premier pledged $1 billion on Monday to help people recover from floods that devastated parts of the western Canadian province. (AP Photo/The Canadian Press, Nathan Denette)

  • Daniel Boddy, nine, helps with the clean-up work as hose lines from pumps drain water from flooded basement in the Bridgeland neighborhood in Calgary, Alta., Sunday, June 23, 2013. Heavy rains caused flooding, closed roads, and forced evacuation across Southern Alberta.

  • Daniel Boddy, nine, helps with the clean-up work as hose lines from pumps drain water from flooded basement in the Bridgeland neighborhood in Calgary, Alta., Sunday, June 23, 2013. Heavy rains caused flooding, closed roads, and forced evacuation across Southern Alberta.

  • A boy crosses a silt covered street in Chinatown as clean-up crews work in Calgary, Alta., Sunday, June 23, 2013. Heavy rains caused flooding, closed roads, and forced evacuation across Southern Alberta.

  • People place sand bags as the river rises rapidly and begins flooding in Medicine Hat, Alberta, on Sunday, June 23, 2013.

  • Homeowner Glenn Tibbles looks at the damage done by floodwaters to his home near downtown Calgary, Alberta, on Sunday, June 23, 2013. About 65,000 residents of Calgary were being allowed to return to their homes Sunday to assess the damage from flooding that has left Alberta's largest city awash in debris and dirty water.

  • Cpl. Brett Martens from CFB Edmonton helps a resident clear out damaged debris from their home near downtown Calgary, Alberta, on Sunday, June 23, 2013. About 65,000 residents of Calgary were being allowed to return to their homes Sunday to assess the damage from flooding that has left Alberta's largest city awash in debris and dirty water.

  • A home is inundated with floodwaters on the Siksika First Nation, Alberta, on Sunday, June 23, 2013. Alberta's municipal affairs minister says 27 communities are under a state of emergency as some areas begin to recover from flooding while others are still bracing for it.

  • People watch as the river rises rapidly and begins flooding in Medicine Hat, Alta., on Sunday, June 23, 2013. THE CANADIAN PRESS/Nathan Denette

  • Floodwaters inundate homes in Medicine Hat, Alberta, on Sunday, June 23, 2013. Alberta's municipal affairs minister says 27 communities are under a state of emergency as some areas begin to recover from flooding while others are still bracing for it.