Opening the case against accused Thomas Mair, prosecutors said Mrs Cox was ‘brutally murdered’ by the defendant, who was heard to repeatedly say “Britain First” during the attack.
The gun used was a .22 weapon, which had been adapted, the court in London was told, and Mair also used a dagger-like knife in the attack
The murder took place while Mrs Cox was performing her role as an MP in Birstall.
Richard Whittam QC, opening the trial this afternoon, said: “Thomas Mair’s intention was to kill her in what was a planned and pre-meditated murder for a political and/or ideological cause.”
Every effort was made to save Mrs Cox’s life and an emergency thoracotomy, where an incision is made into the chest wall, was performed as she lay in the street, the court heard.
The jury was told that Bernard Carter Kenny, a 77-year-old local man, risked his life in an effort to save that of Mrs Cox and was stabbed once by the defendant with the same knife he had used to stab the mother-of-two.
Mr Whittam told jurors: “As she arrived she was brutally murdered by one of her constituents, this defendant, Thomas Mair.
“It was a cowardly attack by a man armed with a firearm and a knife.
“Jo Cox was shot three times and suffered multiple stab wounds.
“During the course of the murder Thomas Mair was heard by a number of witnesses to say repeatedly ‘Britain First’.”
On the morning of the killing, Mair was seen by a neighbour leaving his home in Lowood Lane wearing a white baseball cap, green jacket and dark trousers.
Jurors were shown more CCTV footage of him making his way along the road.
Mrs Cox arrived for her surgery with her manager Fazila Aswat and senior caseworker Sandra Major at 12.50pm.
Mair launched his attack two minutes later in front of shocked passersby.
Mr Whittam described it as a “dynamic, fast-moving and shocking incident”.
Shelly Morris, who was the first to call 999, reported hearing “a loud bang like a popping sound” and “a loud piercing scream”, jurors were told.
She allegedly saw a man with a large steak knife with a jagged blade, which he wielded in a “stabbing motion”.
The attacker stood over a figure and fired a gun twice, according to her account.
Ms Aswat saw Mair come up behind the MP and stab her, then shoot her with the gun.
He proceeded to attack Mrs Cox and Mr Carter-Kenny with the knife before firing again at the politician, Mr Whittam said.
Ms Aswat hit Mair repeatedly with her handbag but was forced to retreat.
She allegedly heard the defendant shouting: “This is for Britain, Britain will always come first.”
Ms Major heard him say “we’re British independence” and “Keep Britain independent”, jurors were told.
The court has been told how Mrs Cox visited a school and a care home on June 16, before heading to the library in Birstall.
The jury of eight men and four women were told that the circumstances of Jo Cox’s death are “shocking” but they must not let emotion or sympathy affect their judgement.
Jurors were shown CCTV of Mair visiting the library in Birstall on the afternoon before the murder. He was shown entering the library shortly before 5pm, going up to the main desk, showing his library card and then going to use one of the public computers.
Police later seized the computer so that they could see what he had been looking at online during the hour or so spent there.
Mair was a regular visitor to the libraries in both Birstall, where he lived, and the neighbouring town of Batley, the jury was told.
On May 17, he accessed a Wikipedia page for ‘Occidental Observer’ which is described as ‘a far right online publication that covers politics and society from a white nationalist and anti-Semitic perspective’.
On June 13, Mair accessed Jo Cox’s page on twitter and her Wikipedia page. He also looked at a Wikipedia page about Ian Gow, the Conservative MP murdered by the Provisional IRA, the jury was told.
He went on to view information about former foreign secretary William Hague, another Yorkshire-based Remain supporter.
Mair also looked at answers to the question: “Is a .22 round deadly enough to kill with one shot to human’s head?”.
Items found at Mair’s home in Lowood Lane, Birstall, showed he had “strong political and ideological interests”, Mr Whittam said.
Mrs Cox’s parents and sister sat in court as the prosecutor told jurors to apply cool logic in the “shocking” case.
The trial is being heard by senior judge Mr Justice Wilkie and is expected to go on for up to three weeks.
Thomas Mair, 53, allegedly shot and stabbed the 41-year-old outside her constituency surgery in Birstall, near Leeds, on June 16.
He is charged with Mrs Cox’s murder, possession of a firearm with intent to commit an indictable offence and possession of an offensive weapon - a dagger.
Mair, from Birstall, is also charged with causing grievous bodily harm with intent to Bernard Carter-Kenny on the same date.
He denies all the charges against him.
Eight men and four women were sworn in at the Old Bailey to hear the case.
Trial judge Mr Justice Wilkie told them that the prosecution would outline the case at 2pm.
He warned jurors not to do any research on the internet and only discuss the case when they were all together.
He also asked them to avoid watching or reading anything about the case which had already attracted considerable publicity.
The trial is expected for go on for up to three weeks.