A police officer in Argentina has been promoted after she comforted a crying baby by breastfeeding him.

Celeste Ayala was on duty at Sor María Ludovica children’s hospital near Buenos Aires when she heard the cries.

After speaking with hospital management, she breastfed the baby, who had recently been taken away from his mother, Buenos Aires provincial police told CNN.

News of Ayala’s compassionate deed spread after her colleague, Marcos Heredia, posted a picture on Facebook of her feeding the baby last week.

Hereida wrote: “I want to make public this great gesture of love that you made today with that baby, who you did not know, but for whom you did not hesitate to act like a mother. You did not care if he was dirty or smelly … Things like that are not seen every day.”

The post has been shared more than 100,000 times. The incident took place on 14 August, which coincidentally is national day of the female officer in Argentina.

Ayala meets officials as she is promoted from officer to sergeant. Photograph: Cristian Ritondo/Twitter

Ayala told the website Cronica: “I noticed that he was hungry, as he was putting his hand into his mouth, so I asked to hug him and breastfeed him.

“It was a sad moment, it broke my soul seeing him like this. Society should be sensitive to the issues affecting children; it cannot keep happening.”

Local media reported that the baby was one of six siblings who were malnourished.

Announcing Ayala’s promotion from officer to sergeant, Cristian Ritondo, the minister of security of Buenos Aires province, tweeted: “We wanted to thank you in person for that gesture of spontaneous love that managed to calm the baby’s cry. That’s the type of police we’re proud of, the police we want.”

The local fire department, for which Ayala volunteers, also praised her, saying “actions like this fill us with pride”.