A man killed his sister and repeatedly stabbed his mother before taking his own life weeks after he was discharged from a psychiatric ward.

Melvin James carried out the fatal attack a month after he was sent home from Royal Edinburgh Hospital with the all-clear in February.

An inquest is under way into the deaths of Melvin and his sister Anne-Marie James in Oldbury, West Midlands.

Melvin died of multiple stab wounds, which a pathologist told the Black Country senior coroner were "only compatible with self-infliction".

Younger sister Anne-Marie James, 33, was found dead in the flat's hallway in Leasowes Drive with a fatal stab wound to her heart. She had 17 knife-related injuries in total.

His mother has previously told the coroner how in an attack on March 8, she told her son "I love you" as he repeatedly stabbed her.

Melvin's younger brother Leon James told the inquest he picked up his sibling alone, waiting in the hospital car park, and drove him home to Wolverhampton, on February 10.

Melvin, who had been living in Edinburgh before he was admitted to the hospital, went to live with his mother.

On Tuesday, the inquest jury heard details of how Mr James had earlier been admitted to a psychiatric treatment ward in Edinburgh.

Police had found him walking without shoes in the early hours of February 4.

Mr James later told doctors he was trying to walk "to Wolverhampton".

Dr Norman Nuttall, consultant psychiatrist at the hospital with overall responsibility for Mr James' care, said his admission was voluntarily but he was sectioned when he tried to leave.

Over video link, he added: "Mr James appeared to be acutely medically unwell. He was voicing delusional ideas."

Mr James believed he was "a character from Transformers" and "referred to his father as Optimus Prime".

Dr Nuttall continued: "He talked about possible links between famous contemporary figures such as Donald Trump, Barack Obama and older figures such as Hitler.

"He made reference to having taken alien eggs or purple pills."

Mr James had also spoken of "a clown that could brainwash him" that offered a choice of "kill or be killed".

The doctor was asked by the James' family lawyer Charlotte Law if he had assessed the 36-year-old as a danger to others.

He replied: "I felt when he was unwell, he did represent a risk to himself through his behaviour on admission.

"But that statement, where he talks about 'the clown could brainwash him', 'kill or be killed' - he doesn't think it could happen here."

Following observation and the discovery of an opioid - doctors believed was possibly from a psychoactive substance - in his blood, Mr James was diagnosed with a "drug-induced psychosis".

His condition improved and he later told doctors his delusions were "rubbish".

Dr Nuttall said by the Friday he was "very happy to suggest that really Mr James could be discharged".

In evidence, he described the lack of a handover to Mr James' younger brother as "unfortunate".

Asked if it was a "missed opportunity", he replied: "It is certainly unfortunate that it happened that way. I wasn't aware that had happened."

Leon James had told how, driving back to Wolverhampton, his brother had started talking of "Transformers and the Illuminati".

Dr Nuttall added: "It's regrettable we didn't speak to Leon about that in more detail, yes."

Dr Iain Proven, who carried out the discharge assessment, said Mr James "was adamant the thoughts he had on admission were, in his words, 'really odd' and 'not true'".

Asked what contact he had with Leon, he replied: "Regrettably, during Melvin's stay, I had no conversations with Leon."

The inquest continues.