Firefighters found the boy in a van outside the Silver Dollar Casino in Calgary.Firefighters found the boy in a van outside the Silver Dollar Casino in Calgary. (CBC)

A man who left his toddler in a locked car outside a Calgary casino has had a charge of child abandonment against him withdrawn.

In March 2009, the man — who can't be named, in order to protect the child's identity — left his 21-month-old boy alone in the car in light pajamas outside of the Silver Dollar Casino in southeast Calgary.

The temperature outside was –9 C.

A casino patron heard a child crying shortly after midnight and called for help.

Firefighters got into the car and removed the child, who was covered in vomit.

The court heard Wednesday that the 52-year-old single father was a pathological gambler who had lost more than $2 million since moving to Canada 13 years ago.

He had already pleaded guilty to an offence under Alberta's Child, Youth and Family Enhancement Act.

He was given a year-long conditional sentence, including a ban on gambling in casinos or bingo halls, and has regained custody of his child.

The boy was uninjured in the incident.