A speech by controversial commentator Katie Hopkins during a university debate prompted a mass walkout in protest at her invitation.

Rows of Brunel University students stood and turned their backs as the firebrand columnist took her turn to speak about the future of welfare, before filing out when she had finished.

The 40-year-old television personality, who has caused outrage with her views on benefits and the migrant crisis, was left with a half empty lecture theatre for the rest of the event.

Hopkins's invitation to take part in the debate led may students at the "diverse" university to complain, although officials decided to keep her on the panel.

Ali Milani, president of the Union of Brunel Students (UBS), who helped organise Monday's "silent protest", said: "Katie Hopkins has expressed some overtly controversial views that our students find offensive.

"We have a very diverse campus, we expressed our concerns that she has no academic credibility and contributes nothing to the debate."

Mr Milani, 21, said the union raised its objection to Hopkins's involvement with organisers last month.

"This was clearly an act on the university's part to fill a room and be controversial," he said.

A number of students approached the union, which agreed to represent them and organise the walkout.

"We have to have a conversation about how we feed the oxygen to online trolls and Katie is a symbol of this.

"Our students turned their backs and they left an empty lecture theatre for her to speak to."

The union leader said "around 50%" of the audience were left in the auditorium.

The debate, which posed the question Does the Welfare State have a place in 2015?, and had the Guardian's public services editor David Brindle as chairman, was the first in a series to celebrate Brunel University's 50th anniversary year.

Sitting alongside Hopkins on the panel was the university's emeritus professor of social policy Peter Beresford, campaigner for social justice Rev Paul Nicolson, and Harriet Sergeant, a research fellow for the Centre for Policy Studies.

The university recognised the students' right to stage a peaceful protest and said the rest of the debate was "passionate" and the remaining audience "played a key role".

Mr Milani said the union only came to realise Hopkins was due to speak after she announced she had accepted the invitation on Twitter.

"The first thing I heard about it was when my in-box exploded with students saying 'have you seen this?' with links to the tweet."

He admitted the union had missed a meeting with university officials to discuss the 50th Anniversary programme when the invite list was raised, but claimed there was "nowhere near enough consultation".

The union did not ask for Hopkins to be banned, but urged organisers to reconsider her invitation.

"We raised our concerns from the outset. We said our students didn't want her on the panel," he said.

A video of the walkout uploaded to the Union of Brunel Students' YouTube channel has been viewed more than 18,000 times.

It shows applause for a previous speaker sharply subsiding as the floor was handed to Hopkins, before rows of students stood and turned their backs as she began to speak.

Hopkins can be heard saying public services that are free at the point of use "bring out the very worst in human behaviours" and "makes us ungrateful".

Mr Nicholson, the founder of Taxpayers Against Poverty, sat on the panel and argued for the future of the Welfare State supported by a new tax regime.

He said: "I have got no problem with whoever being given the opportunity to state their case. I opposed it (hers) of course. The room turned against it - they walked out."

As the video attracted nearly 70,000 views Hopkins took to Twitter, referring in a post to the "Offended Young Nation".

She wrote: "Many thanks to the students of #brunelmassdebates for getting me trending on Facebook. You rock. #bruneldebates."

She later tweeted: "Looking forward to speaking at Cambridge Union next week #brunelmassdebates."