Mrs Cox’s senior caseworker, Sandra Major, said her alleged murderer shouted, “Keep Britain independent or British independence” during the attack on June 16.
The Labour MP was stabbed 15 times and shot three times, including twice in the head, as she arrived to hold a surgery at Birstall Library in her Batley and Spen constituency.
She arrived with her assistants Fazila Aswat and Ms Major, both of whom witnessed the attack.
Ms Major said told the jury at the Old Bailey that saw Mrs Cox shot in the temple.
She said: “She fell backwards on to the ground. There was all blood pouring down her face.”
Richard Whittam QC, prosecuting, asked: “Do you remember hearing a man say anything?”
She replied: “He did shout something out. It was something along the lines of, ‘keep Britain independent’, or ‘British independence’.”
Describing the firearm, she said: “It was a small gun. It wasn’t a shotgun. It was a smaller gun, but it was quite deep.
“He had a shopping bag. To the best of my recollection the gun was in his right hand and the bag was in his left.
“It had a small metal tube sticking out of the end of it.
“He got a knife out of the bag. It was black.”
Mr Whittam said: “Was Jo standing up?”
She said: “Jo was lying on the floor, and she sort of tried to sit up a little bit with her right hand.
“He just started stabbing her while she was lying on the floor, stabbing her, and Jo was trying to get away.
“Fazila was shouting ‘get away from us, she has got two little children’, and I was just screaming and shouting for help.
“She couldn’t get up, but she sort of rolled over and sort of did a sideways roll and went into the road.”
Asked if the man went towards Fazila, she said: “He went towards both of us because we were quite close together at that stage.
“He was making motions towards us with the knife, and Jo was lying in the road and she shouted out to us.
“She said ‘get away. Let him hurt me, don’t let him hurt you’.”
Mair briefly left the scene and crossed the road, before returning to resume his attack, the court heard.
Ms Major said: “He didn’t go very far, just a few feet and then he came back and he shot her twice more, and started stabbing her again.
“She was on the floor, she didn’t get up again.”
Ms Aswat told the court, “our lives changed forever” as she watched Mrs Cox killed in front of her.
She begged the MP to think of her children in a desperate bid to keep her alive.
Emergency services arrived but Mrs Cox could not be saved, and she was pronounced dead at the scene at 1.48pm.
Ms Aswat became officer manager and personal assistant to Mrs Cox when she was elected in May 2015.
She described parking the car in the street outside the library shortly before the attack.
She said: “I got out of the car and I was stood on the roadside.
“Jo walked over to the side of the pavement. Sandra, she was already there.
“In that instant, our lives changed forever.
“The next thing I saw was Jo was on the floor and this man was stood over her with a knife.”
Ms Aswat started shouting for help, and heard a gun shot and saw Mrs Cox getting stabbed.
She said: “I can remember the hand motion, it was really fast, so I cannot say which hand he used.”
Mr Whittam said: “Did you encourage her to run away?”
She replied: “I shouted, ‘Jo, you need to run’.
“After the first part of the incident, the man seemed to be retreating, so I ran back towards Jo.
“At that time, everything was focuses on Jo.
“I said, you need to get up. At that time she was talking - ‘Fazila, I cannot run, I am hurt’.”
Even at that time, she was “so composed”, but unfortunately “he then came back”, she told the court.
Ms Aswat said: “Jo was no longer on the pavement, we were on the road.
“When he first came back, I was standing over Jo, and I was saying to her, I was referring to her children - ‘just think of X and Y, you need to get up and run’.
“I started swinging my handbag and he swiped his knife towards me several times - not necessarily to attack me but to get me away from Jo, because he wanted to get her again.”
She said she then heard a further two gunshots, and saw him stabbing Mrs Cox again.
Asked if he said anything during he attack, she told the court: “Not during the attack, it was at the very end. He stood up and said, ‘Britain first’.”
He then left the scene and headed down the road, she told the court.
She added: “Jo was in my arms.
“It probably took about three or four minutes for the police and ambulance to arrive. But at that moment, it felt like a lifetime.”
Mair, of Birstall, West Yorkshire, denies murder, grievous bodily harm with intent, possession of a firearm with intent to commit an indictable offence and possession of an offensive weapon - namely a dagger.
Earlier, a police officer described to the court how he “rugby tackled” Mair to the ground after spotting him on the streets of Birstall a few minutes after the attack.
Pc Craig Nicholls of West Yorkshire Police, was on duty with Pc Jonathan Wright on the afternoon of June 16, arrested Mair while unarmed.
Mr Nicholls described being given directions to search for the man involved in the shooting.
At about 1.20pm they were in the Leeds Road area and were travelling in the direction of Morley. It was here that they saw someone who they thought fitted with the description given, the jury was told.
Mr Nicholls said the man was on the pavement, to the near side of the vehicle as they were travelling. He was wearing a black baseball cap and carrying a black holdall in his right hand
He said: “I said to PC Wright: ‘Is that him?’ We drove past initially. I spun the police vehicle round and at that point the male disappeared.
The officers headed into Whitehorse Close and saw a man turning onto Risedale Avenue, who the jury was told was the same man they had seen on the road.
Mr Nicholls said he knew the road was a cul-de-sac. He said: “When we turned onto Risedale Avenue, he was in the middle of the road, about 20 yards away from where we were.
“PC Wright had his window down and was hanging out of the window while I was holding onto his belt. He was giving directions to drop the bag and show his hands.
“In his right hand he had a black holdall. In his left he had something which was black. I honestly couldn’t tell you what it was at the time.
Mr Nicholls said he was concerned the man could have a weapon and his colleague made several requests for the man to put the bag down, the court heard. The man was facing away from them and dropped the bag to his right hand side, the court heard.
The witness told the court: “He turned around very quick. He put his hands into his pockets. Change fell out of his pockets.”
He said the man then put his arms out to the side and said: “It’s me.” It was not in reply to any question.
The officers got out of the vehicle and ran towards the man. He was wearing a light grey shirt with short sleeves which was loose fitting.
Mr Nicholls said: “As we started running towards him, he’s gone to put his hands down the front of his shirt. We rugby tackled him to the ground.”
The officers were then able to detain the man. Mr Nicholls agreed it was a reasonably heavy impact. He said: “Initially I grabbed his arms and hands, and PC Wright put handcuffs on him.”
Mr Wright had asked what the man had on him and the man said he had a knife in his pocket, but a knife was not found. A bag of what looked like a large amount bullets was found in his trouser pocket, the court was told.
The court heard that the witness asked about the gun and the man said it was in the bag. He said he thought was what looked like a pistol in the bag.
At 1.30pm, the man told the officers: “I’m a political activist.” Armed officers arrived at the scene shortly afterwards, the jury heard.
Simon Russell Flint QC, for Mair, suggested that the defendant did not shout “It’s me” or claim to be a political activist and had remained silent throughout his arrest.
Cross-examining Pc Nicholls, he said: “There is a lot of radio noise. The (police) car engine is running. You are 20 yards away. Pc Wright is shouting at him (Mair) to drop it (the bag). You are still in the car, as is Pc Wright.
“And you are saying you could both hear something like ‘It’s me’?”
Pc Nicholls replied: “He did say it.”
Mr Russell Flint continued: “I’m going to suggest that is not correct. Nothing like that was said like that by this man.”
Pc Nicholls replied: “That is what I heard.”
The defence barrister also alleged that Mair had not said he was a political activist, adding: “I’m going to suggest that no such thing was said by Mr Mair.”
Pc Nicholls again said he heard it uttered by the defendant.
Mr Russell Flint went on: “You say he was asked what he had got on him and he said he had a knife in his pocket?”
Pc Nicholls said: “That’s correct.”
Mr Russell Flint said: “There was no knife in his pocket and I’m suggesting he did not say he had a knife in his pocket.”
Pc Nicholls responded: “The defendant said he had a knife in his pocket.”
The lawyer also asserted that Mair said nothing about having a gun, and suggested that one of the officers commented “We are going to get into trouble for this”, but Pc Nicholls denied it.
Jurors were shown images from the scene of Mair’s arrest, including the black holdall containing the sawn-off German-made .22 rifle prosecutors allege was used in the murder.
They were also shown an image of a baseball cap lying in a splatter of blood, with jurors told that Mair suffered a head injury while being arrested.
They were also shown a short video clip taken by someone living in the street, showing Mair being arrested.
Pc Wright echoed his colleague’s account of Mair’s arrest.
He said: “As we ran towards him - I cannot remember getting out of the vehicle - the next thing I remember is running shoulder to shoulder with Pc Nicholls as fast as we could.
“As we reached the male, his arms moved towards his belt line. I was fearful because he had a loose-fitting shirt and I could not see what he had underneath so we both took him to the ground.
“I asked him ‘What have you got on you?’ and he told me ‘I’ve got a knife in my pocket’.”
After searching his pockets, the officer said he saw a gun in the defendant’s holdall.
He said: “I opened the bag to have a look in it. I saw a firearm.”
He also found a bag of bullets, he added.
Mair, 53, of Lowood Lane, Birstall, is accused of murdering Mrs Cox, 41, on the afternoon of June 16.
He also faces charges of possession of a firearm with intent to commit murder, possession of an offensive weapon – a dagger – and causing grievous bodily harm with intent to Bernard Carter Kenny.
Mair denies all four charges.
The trial continues.