Emergency services rescued a man threatening to jump from a bridge near the Polish War Memorial roundabout in Hillingdon .
The man was seen climbing over bridge railings at around 10:30pm on Wednesday (August 1) and sat with his feet dangling over the edge until emergency services arrived.
Both sides of the A40 had to be closed for about an hour while he was brought back to safety.
An eyewitness, 44, told getwestlondon : "I could not believe what I saw, I have seen people do it on motorways when I have been stuck in traffic but you never think it's going to happen in front of your eyes.
"I just hope that he got the help that he needs because you have to be desperate to do something like that.
"I was driving past and I saw out on the left hand side that he had walked across but I thought he was just crossing the road.
"Next thing his legs were over the railing so I went around the roundabout again so I could call the police. They showed up while I was on the phone so someone else must have called it in."
A police spokeswoman said they received a call at 10:33pm and attended along with ambulances and the fire brigade.
She added that officers spoke to the man and got him to come down to safety, after which he was detained under the Mental Health Act.
A London Ambulance Service spokesman said: "We sent an incident response officer and a single responder in a car.
"We didn't treat any patients or take anyone to hospital."
Where to get help if you're struggling
You don’t have to suffer in silence if you’re struggling with your mental health. Here are some groups you can contact when you need help.
Samaritans: Phone 116 123, 24 hours a day, or email email@example.com, in confidence
Childline: Phone 0800 1111. Calls are free and won’t show up on your bill
PAPYRUS: A voluntary organisation supporting suicidal teens and young adults. Phone 0800 068 4141
Depression Alliance: A charity for people with depression. No helpline but offers useful resources and links to other information
Students Against Depression: A website for students who are depressed, have low mood, or are suicidal. Click here to visit
Bullying UK: A website for both children and adults affected by bullying. Click here
Campaign Against Living Miserably (CALM): For young men who are feeling unhappy. Has a website and a helpline: 0800 58 58 58