Halifax Regional Police say a man who allegedly tried to take a child out of a Walmart shopping cart last month was actually trying to help the boy.

On Aug. 29, police released a statement saying a woman and her two children left the Walmart on Chain Lake Drive and walked to her vehicle in the parking lot around 9:30 a.m.

Police said as the woman was putting items in her vehicle, she looked up and saw a man she didn’t know holding her two-year-old son, who had been seated in the shopping cart.

Police say the woman reached over and took the child from his arms, and he then walked away.

Halifax Regional Police issued a statement Tuesday saying the man had been identified. The man told police that he noticed the child standing in the seat portion of the shopping cart and was afraid for the safety of the boy.

The man told officers he picked the boy up and handed him back to his mother.