A man in his late 40s to early 50s also suffered slight injuries, police said.

One witness told the Press Association that Cox had intervened in a scuffle between two men, one of whom pulled a gun from a bag and then fired twice.

TV footage showed the surrounding area had been sealed off.

EU referendum campaigning suspended

Following the attack, both sides in Britain's upcoming referendum on leaving or staying within the European Union said they were suspending campaigning for the day, while Cameron said he would pull out of a planned rally in Gibraltar.

The Stronger in Europe camp said it was "suspending all campaigning for the day", while a spokesman for the rival Vote Leave group, which is backing a so-called Brexit, said that their "battle bus" had stopped campaigning for the day.

Labour MP Kate Osamor welcomed the decision to suspend campaigning, adding that the attack had caused concern among other politicians over their own security.

"I don't know what the motivation can be, which is more worry for all of us, parliamentarians doing our job," she told Al Jazeera.

Cox, a Cambridge University graduate and aid worker, became a Labour MP for Batley and Spen last year. Known for her work on women's issues, Cox has worked with several charities.