A hairstylist was about three months pregnant when she stabbed her former boyfriend, who is the baby's father, in a lift following a dispute.
The Institute of Mental Health (IMH) later diagnosed Pang Shi Luan, 24, as having an adjustment disorder.
She pleaded guilty in court last November to assaulting delivery driver Marcus Fong Zhi Wei, 23.
Yesterday, District Judge Eddy Tham sentenced Pang, who is due to give birth soon, to a nine-month mandatory treatment order.
This means that in lieu of jail time, she has to undergo treatment for her mental condition.
But the order can be revoked if she re-offends or fails to comply with the conditions of her treatment.
According to the IMH website, an adjustment disorder is a short-term maladaptive response to a stressor, resulting in the development of emotional and/or behavioural symptoms.
It said that the stressor is generally an event of a serious and unusual nature that an individual experiences. Court papers did not mention any details about Pang's stressor.
At around 2pm on June 10 last year, Pang met Mr Fong at Block 203, Ang Mo Kio Avenue 3, where he lived.
Deputy Public Prosecutor Zhuo Wenzhao said: "While at the block, the accused kept pestering the victim to rekindle their relationship. However, the victim refused."
Two hours later, they entered a lift at the block and got into a dispute.
Pang, who was holding a sharp piece of metal, used it to slash Mr Fong's left arm. She also stabbed his upper back before biting his left shoulder.
The lift went up to the third storey, and one of Mr Fong's neighbours, who heard the commotion, pulled Mr Fong out when the lift door opened. Pang fled the scene by running down the stairs.
DPP Zhuo said cameras inside the lift and at the lift lobby captured the attack. Footage showed that Pang was the aggressor.
Mr Fong went to Khoo Teck Puat Hospital, where he was found to be suffering from injuries such as stab wounds on his right shoulder, a deep cut on his left elbow and multiple small wounds in his back.
For assault, Pang could have been jailed for up to two years and fined up to $5,000.