The attack took place near a public library in Birstall in West Yorkshire, said police.
Cox, 41, Labour MP for Batley and Spen, was left bleeding on the ground by her attacker.
A 52-year-old man was arrested nearby.
According to eyewitness quoted by the BBC, Cox was shot twice and as she fell, shot yet again in the face area by the attacker. As a passer-by grappled with him, the assailant also stabbed Cox repeatedly.
She was taken to hospital but succumbed.
Prime Minister David Cameron and Labour party leader Jeremy Corbyn were among the politicians paying tribute, while Vote Leave and Remain have both suspended campaigning in the EU referendum in light of the attack.