A drug-using Afghan policeman turned his gun on two British service personnel in an attack prompted by him being publicly humiliated, an inquest has heard.

The policeman, known as Naqib, and another off-duty Afghan policeman, killed Corporal Channing Day, 25, and Corporal David O'Connor, 27, while the victims were on foot patrol on 24 October last year in Helmand's Nahr-e-Saraj district.

Day, of 3 Medical Regiment, was the third British servicewoman killed in Afghanistan since 2001. She had been deployed a month earlier to provide medical support to 40 Commando Royal Marines, O'Connor's unit.

The British pair were on their way to train local police in first aid and spotting roadside bombs when their patrol was attacked near the village of Char Kutsa.

Their inquest at Oxford county hall heard that in the aftermath of the attack – in which Naqib was shot dead and the other gunman escaped – other Afghan policemen appeared unhelpful.

Oxfordshire coroner Darren Salter, who recorded a verdict of unlawful killing while on active service, said the day before the attack Naqib and his brother "lost face" when they were disarmed by British soldiers at a patrol base.

"First of all, to the extent that there was any doubt before, this was, and should be termed as, an insider attack," Salter said.

Describing Naqib, he said: "He was a known identified member of the Afghan Uniformed Police (AUP) and he was the person responsible for the inside attack.

"In terms of his motive, that is always going to involve some speculation, of course, because he is deceased. It doesn't seem clear, and certainly there is no evidence, that he had any links to the insurgents or the Taliban.

"The incident the day before when Naqib and his brother were stopped does seem to be a matter that contributed. And there was a loss of face of both him and his brother.

"It appears in evidence, particularly in evidence from the persons that were present, that it was this individual who fired the shots on Day and O'Connor before he was killed.

"It seems likely that there was a second attacker. It is clear to me in evidence that it was the attacker Naqib who fired first."

Day and O'Connor were the last two members of an eight-person patrol group. Directly in front of them was intelligence expert Corporal Nick Brown, who said he had seen Naqib, whose AK47 had orange tape wrapped round it, several times in the weeks before.

He said he was usually friendly and they would communicate with each other in broken English or Pashtu, or by using hand gestures. Brown said Naqib was known to be a drug user.

Asked if he looked like he was under the influence of narcotics on the day, he said: "He did seem a bit vacant."

Naqib's brother was the commander of a local checkpoint and two of their brothers had been killed by insurgents, said Brown, making it unlikely they had joined the Taliban.On the afternoon of the attack, Naqib walked up to Brown outside the checkpoint and made a signal with his fingers that mimicked legs walking. The serviceman thought the Afghan was asking if the British troops were on patrol or whether he could join their patrol.

"He was smiling, laughing, smirking," said Brown. "I had met him before and I didn't perceive him to be a threat. He seemed very innocent, as it were."

Philip Benford, who was in command of the patrol group, said he saw two men fire at them with Kalashnikov weapons as they arrived at the checkpoint.

"I distinctly remember that first initial contact," he said. "When I span round, there was another fast, furious volley of rounds and it was from a gunman who ran behind the wall." The troops fired back at their attackers, killing Naqib.

Day was born in Swindon and grew up in Newtownards, Co Down, before joining the army in 2005.

O'Connor, who lived with his mother Rosemary in Havant, Hampshire, was deployed to Afghanistan at the end of September last year.

The inquest heard that the victims both died from single gunshot wounds.