A man who slashed his ex-girlfriend's face with a knife after getting dumped on Facebook has been jailed for six years.

Allan Ferguson crept into Nicola Milligan's flat using a spare set of keys before attacking her.

Ms Milligan, 29, was stunned when she awoke to find the 53-year-old standing over her holding a large kitchen knife.

Ferguson grabbed her by the chin and carved her lip and cheek, leaving her scarred for life.

He then turned the weapon on Nicola's brother James Glen and friend Scott Allan as they ran to help.

On Thursday, at the High Court in Edinburgh, judge Lord Turnbull told Ferguson that he was going to jail.

The judge praised Mr Glen's attempts to stop the assault, saying: "You launched an uncontrolled attack which was fuelled by rage and alcohol. It was an attack in which you cared not about the fate of your victims.

"One of your victims was left permanently disfigured.. another had their life endangered.

"Had it not been for the brave intervention of Mr Glen, there is no telling how this attack could have ended.

"I am satisfied that the only way to deal with this crime is to impose a substantial custodial sentence."

Ferguson, of Johnstone, pleaded guilty at the High Court in Glasgow in December 2015. He admitted to committing three counts of serious assault at an address in the town's High Street on September 6 last year.

At earlier proceedings, the court heard Ferguson dated Nicola, who is 24 years his junior, for four months until they separated in September.

The court heard Ferguson was upset he had been dumped online and begged to be taken back. He was traced days after the attacks in Gourock but made no comment when questioned by police.

On Thursday, defence advocate Frances Connor told the court that her client was an alcoholic and that he was remorseful for what he had done.

Ms Connor added that Ferguson was unable to tell court appointed psychologists exactly why he committed the attacks. She added: "He is unable to provide an explanation for his actions. However, he is genuinely remorseful.

"He would like to offer his abject apologies to his victims for the terrible physical and psychological abuse that he subjected them too."

Lord Turnbull told Ferguson that if he had not pleaded guilty, he would have received a nine-year sentence.