Several tanker cars carrying ammonia derailed just north of Airdrie, Alta., on Tuesday, forcing the evacuation of three nearby farms as a precaution. ((Larry MacDougal/Canadian Press))

A Canadian Pacific train that derailed north of Calgary did not leak any of the anhydrous ammonia it was carrying, officials confirmed Tuesday.

Thirty cars of a southbound CP train left the tracks at 7:15 a.m. MT about 1½ kilometres north of Airdrie, said officials from CP and the City of Airdrie.

Eight tanker cars that derailed at the rear of the train contain anhydrous ammonia, a hazardous chemical used to make fertilizer. Several grain cars in the middle section of the train also jumped the tracks.

A hazardous materials team was dispatched from Calgary to inspect the overturned cars, but no leaks were detected, Airdrie RCMP said.

Calgary and Airdrie fire crews, along with environmental experts from CP, were still assessing the site. The cause of the derailment has not been determined.

Officials evacuated three farms within 400 metres of the incident and were monitoring the air quality to the south. There are no plans for any further evacuations.

There were no reports of injuries but the rail cars involved were heavily damaged.

Airdrie is about 20 kilometres north of Calgary.