A man tried to kill four young children by hitting them with a hammer before crashing a car into a wall.
Owen Scott, 29, was arrested after the car he was driving crashed into a pub near Penistone , South Yorkshire, in August last year.
Four children were in the vehicle - two girls, aged seven and eight, and two boys aged 21 months and nine months.
They were all taken to hospital in a serious condition with injuries "not all thought to be consistent with the collision", according to police at the time.
At a previous hearing, prosecutors said Scott had used a hammer to inflict blows on the children in the car and had then driven deliberately at the front wall of The Travellers Inn, on the A629 between Sheffield and Huddersfield.
On Monday, Scott stood in the dock at Sheffield Crown Court wearing a grey buttoned-up shirt and dark trousers to plead guilty to four charges of attempted murder and one charge of dangerous driving.
Flanked by one security officer, he spoke only to confirm his name and enter his pleas.
No details of the incident were given during the short hearing but Michelle Colborne QC, defending, said: "In relation to the events in the car he has little or no memory".
Miss Colborne said her client had undergone a psychiatric evaluation and although he was found to be suffering from a "short-lived psychosis" at the time, this was not enough to amount to a psychiatric defence to attempted murder.
She said: "There is mitigation which demonstrates that, at the time, it was likely he was suffering from a psychosis, short lived, affecting his ability to rational thought and self control, but falls short of a defence."
The grey Dacia Logan was travelling along the A629 Copster Lane when it left the road and crashed into the front wall of the pub in the Oxspring area of Barnsley at about 12.25am on August 23.
Scott, of Heather Road, Fawley, Hampshire, was remanded in custody by the judge, Mrs Justice O'Farrell, who said further psychiatric reports were needed.
He will be sentenced on February 15.