A man was shot dead by four armed police officers after firing an air pistol at one of them, an inquest heard.

Shortly before the incident, Spencer Ashworth told a relative he had a “new James Bond air pistol” and said he wanted to move to the US.

Ashworth, 29, a part-time courier, was fatally wounded by Avon and Somerset police officers near the M5 outside Bristol on the morning of 27 September 2017.

He had been driving south on the motorway when police received reports of a man shooting what appeared to be a gun out of his car window. Firearms officers stopped Ashworth, who was driving alone in a red Suzuki Swift, and surrounded his car.

Maria Voisin, the senior coroner for Avon, told jurors at Avon coroner’s court: “Officers shouted instructions for Spencer Ashworth to leave the vehicle and place his hands where they could be seen.

“It seems the deceased did not comply. He could be seen to raise a gun in his right hand and fired what is now known to have been an air pistol at one of the attending officers. Four of the five officers returned fire, discharging 15 rounds at Mr Ashworth.”

In a statement, Ashworth’s mother, Yvonne Maunder, said her son became insular in his late teens and would play computer games in his bedroom alone. “He thought everyone hated him,” said Maunder. “He showed all the signs of depression.”

Ashworth moved out of his family home aged 22 to live in Plymouth, Bristol and then Portishead. He spent a lot of time playing computer games such as Grand Theft Auto and Resident Evil, the inquest heard.

In an email sent to his mother in August 2017, Ashworth referred to “my new James Bond air pistol” and said he had wanted to go to California “before I have to shoot it out with the police”.

His housemate in Portishead, Justin Baber, said: “His hobbies were skate-boarding and playing games on his Xbox. He would play shooting games like Call Of Duty.”

Baber said their landlord, Chris Jones, had to tell Ashworth to use his Xbox in his room as he was spending “days or weeks playing on it” in the communal lounge.

Janice Hawley, a probation manager, met with Ashworth in 2016 as part of a sentence he received for assault.

She told the inquest she suspected there was “something else going on” with Ashworth and had suspicions he may have been on the autistic spectrum. “He was quite adamant there was nothing wrong,” she said.

Insp Adam Crockford of Avon and Somerset police said Ashworth’s record on the police national computer had warning markers for “violence, mental health and suicidal”.

The inquest continues.