A one-year-old hit her head on concrete after falling from a pushchair knocked over by a shoplifter being chased down Dunfermline High Street by a security guard.
Drug addict Dean Wishart ran off after being caught trying to steal clothing from Primark.
It was only “good fortune” that prevented the child being seriously injured, Dunfermline Sheriff Court heard.
Depute fiscal Peter Motion told the court security officers watched Wishart acting suspiciously in the store.
He said: “He was seen placing garments in his carrier bag and police were alerted.
“The accused went to the exit, making no attempt to pay. When a security guard requested him to stop he made off, turning left as he exited the store.”
A mother walking along High Street with her child in a pushchair “became aware of a commotion behind them”.
“She turned around and saw the accused running towards them,” Mr Motion went on.
“The accused then pushed the pushchair to the side, causing it to topple over and the one-year-old child to fall out and hit her head on the concrete.
“The security guard and members of the public restrained the accused until police arrived.”
The child was taken to Queen Margaret Hospital after sustaining a bump to the head and her condition was monitored for 24 hours.
At Dunfermline Police Station, Wishart told officers: “I’m sorry for hurting the little girl.”
Defence solicitor Sarah Meehan said her client “struggles with a drug addiction” and had been taking heroin following his release from a previous custodial sentence.
She said Wishart was “deeply ashamed” of the incident involving the child.
“He accepts that it was only through good fortune the child did not receive more significant injuries,” she added.
Wishart, 25, of Redcraigs, Kirkcaldy, admitted that on August 20 he stole a quantity of clothing from Primark’s Dunfermline store.
He also admitted that on High Street he culpably and recklessly pushed a pushchair, causing it to fall to the ground and the child to fall out, striking her head on the ground to her injury.
Sheriff Charles Macnair told Wishart he had a “deplorable” record and imposed a four-month jail sentence.
A further 40 days in jail was added for an assault by Wishart on his partner three days before the Dunfermline incident.
He admitted that on August 17, at a house on Glamis Road, Kirkcaldy, he assaulted Pamela Rattray, his partner, striking her with a door to her injury.