People on all sides of politics must work to unite the country and ensure debate takes place in a “civilised” way in the wake of the murder of Jo Cox, the shadow chancellor, John McDonnell, has said.

McDonnell said the killing of the Labour MP for Batley and Spen in June was part of a trend of abuse and violence that was on the rise within British politics and had been exacerbated by the EU referendum vote, which took place days after her death.

Neo-Nazi Thomas Mair was handed a whole-life sentence at the Old Bailey on Wednesday for the murder of the 41-year-old mother of two as she arrived for a surgery in Birstall, West Yorkshire.

McDonnell told BBC1’s Breakfast: “We’ve all been distressed about what happened to Jo. I think all of us – and it isn’t just politicians, it’s the whole of society now – have to look at how this has come about. Some of it is about the violent nature of our politics at the moment.

“A lot of MPs – Jo’s was a terrible, extreme example, but if you look at some of the abuse some people have suffered. In the past we’ve had it, but it’s on the rise again. We’ve had hate crime taking place, not just against migrants but a hate-crime rise against disabled people.

“I think what we have to be careful about in all walks of life now is to see how we can unite people.

“Even this Brexit vote has divided society. How can we come back together? I think everything we do now is about trying to unite our country, ensure that we engage in democratic debate in a civilised way. We will all learn lessons from this.”