The woman was seen crying, shouting and threatening to throw herself off the 12th floor of a block of flats in Shanghai, China.
After disappearing briefly back inside the apartment she reappeared at the window with her small child and threatened to hurl him to his death before she jumped.
Terror: This is the moment when two lives hung in the balance at a high-rise building in China
Shock: The distraught woman dangles the baby from the window as shocked spectators watch on powerless to intervene
'Don't anyone try to stop me!' she screamed. 'I am serious. I will kill him then myself.'
A large force of police, firemen and medics was scrambled to the building and staged a dramatic rescue operation.
One firefighter risked his own
life by being lowered from a window above where the woman and child were
in an attempt to prevent the pair falling to their deaths.
A police spokesman said: 'It was a very delicate situation. We didn't know if she would hurl the child to its death and then kill herself as she was threatening.
'We summoned a mental health specialist to talk to the woman, to try to calm her down. While this was going on, fire personnel looked for a way to access her apartment without her knowing.'
Long drop: The woman sat nonchalantly on the ledge hundreds of feet above the ground
Drama: A tearful woman is spotted perching precariously from the window of a 12th floor flat in Shanghai
Desperate: Rescuers watch as the baby is held out of the window in the high-rise block of apartments in Shanghai
Action: A firefighter is lowered into the window in a dramatic bid to prevent the woman from throwing the baby from the high-rise block
In the tense stand-off on Wednesday the firemen managed to gently break in through another window into the woman's apartment and sneak up on her as she was talking with negotiators.
The police spokesman added: 'It was fortunate that they were able to seize her and the child at the same time. The situation ended peacefully.'
The woman has been taken to a psychiatric hospital while the child is with foster parents.
It is unclear when she will be reunited with her child
According to media reports, the woman was depressed about being jobless and 'stuck at home' all day.
Terrifying moment Chinese mother threatened to throw her young son from 12th floor balcony then jump to her death before firefighters grabbed her
Woman was thought to have been suffering from depression Emergency services launch dramatic high-rise rescue operation A fireman was lowered from 13th floor window to stop the mother jumping