A man with mental health issues tried to kill his entire family as he drove to spend a holiday in Pembrokeshire, a judge has been told.
Stephen Coops, aged 36, deliberately crashed his car at 60 mph in the hope of killing himself, his partner and her three children.
Coops admitted dangerous driving and was detained under the Mental Health Act following a hearing at Swansea crown court.
Brian Simpson, prosecuting, said Coops and his family had booked a holiday cottage in Roch.
On October 22 last year Coops drove from the family home in Fowey, Cornwall, but during the journey developed the delusion that someone at Roch would try to harm them.
On the A40 at Robeston Wathen a local doctor and his wife were driving 100 metres behind Coops' car when they suddenly saw the vehicle swerve into a barrier at 60mph.
Coops later told police he was under the impression he would be driving over a cliff.
He said he had tried to kill his entire family because he did not want to go to Roch.
He said an unknown man would be waiting for them and would try to harm them.
Coops admitted crashing the car on purpose.
His barrister, John Hipkin, said he wanted to make it clear that Coops loved his family very dearly.
"It is a horrible case. One day he will be able to return to live in the community," he added.
Judge Peter Heywood said he accepted that if Coops had been well he would not be in court.
"It is serious but it is wholly explained by your mental state at the time," he added.
Judge Heywood ordered Coops to be detained at a low security mental hospital until he had recovered and it was deemed safe to release him.
Coops, from Fowey in Cornwall, was also banned from driving for a year.