Media playback is unsupported on your device Media caption The incident was filmed by a motorist

A US woman who was repeatedly punched in the face and head by a police officer at the side of the road will receive $1.5m (£0.9m) in compensation.

Footage posted on YouTube shows a California Highway Patrol (CHP) officer straddling the woman, Marlene Pinnock, on 1 July and hitting her many times.

The settlement agreed on Wednesday came after nine hours of talks between lawyers in Los Angeles.

A CHP statement said the officer, on leave since the incident, has resigned.

"When this incident occurred, I promised that I would look into it and vowed a swift resolution," CHP Commissioner Joe Farrow said in a statement.

"Today, we have worked constructively to reach a settlement agreement that is satisfactory to all parties involved."

Image copyright AP Image caption Pinnock said: 'He was trying to kill me.'

The bulk of the money will go into a special needs trust for 51-year-old Ms Pinnock, the CHP said.

She has been diagnosed with bipolar disorder and had been off her medication for two to three months before the altercation, according to the Associated Press.

Her lawyer Caree Harper said the settlement secured the two things she wanted.

"One of the things we wanted to make sure of was that she was provided for in a manner that accommodated her unique situation in life, and that the officer was not going to be an officer anymore."

Police had said the woman was endangering herself and motorists by walking on the shoulder of a busy highway in the west of Los Angeles.

The incident was captured by passing motorist David Diaz, who said the officer arrived as the woman was walking off the highway, but he "agitated the situation".

The officer, Daniel Andrew, is seen on the video forcing her to the ground, briefly struggling with her before repeatedly punching her.

A few moments later, a plainclothes officer enters the picture and helps his colleague put the woman in handcuffs.

The officer could still face criminal charges. Ms Pinnock will be interviewed by the local prosecutor's office within a few weeks.

In a search warrant made public last month, police said Ms Pinnock had pushed Mr Andrew as he pulled her away from oncoming traffic.

But Ms Pinnock said during an interview with AP Mr Andrew "threw me down" and started beating her.

Image copyright AP

"I felt like he was trying to kill me, beat me to death."

Ms Pinnock told the news agency she had been homeless for the past few years and was on her way to a homeless camp accessible only via a motorway ramp.

The warrant also said Ms Pinnock suffered no signs of physical injury and refused medical treatment, but was placed in a psychiatric medical hold for two weeks.

Ms Harper has previously questioned the medical information on the warrant, saying two doctors who saw her in hospital gave inconsistent views of her injuries.

Prosecutors in Los Angeles declined to charge Ms Pinnock in the incident.