David Cameron has made clear he is ready to pull the UK out of the European convention on human rights if he believes it is necessary to keep Britain safe.

The prime minister said he would do "whatever that takes" to ensure Britain could throw out people who posed a threat to the UK and had no right to be in the country.

He said voters could be confident that a Conservative government after the 2015 general election would make sure this was done, though he indicated it would not be possible if he was again in a governing coalition with the Liberal Democrats.

Cameron told BBC1's Andrew Marr Show: "What we need to do is look and think what is the outcome we want. I'm less interested in which convention we are signed up to.

"As prime minister, I want to know can I keep our country safe. So, for instance, are we able to chuck out of our country people who have no right to be here, who threaten our country? I say we should be able to do that. Whatever that takes, we must deliver that outcome.

"We have the next 20 months to put into our manifesto whatever measures need to be taken to produce the effect we want, which is basically to have greater ability to keep our people safe."

Cameron said there were several options for ensuring that future prime ministers have greater powers to remove those who pose a threat to public safety.

This could involve the creation of a British bill of rights, which would allow the UK to remain within the convention while being sure that judges at the European court of human rights respect Britain's decisions, he said.

But asked if it could mean withdrawing from the convention, he replied: "It may be that that is where we end up, but let's go through the process and work out what is necessary to deliver the effect that we want."

He added: "People should be in no doubt, under a Conservative-only government led by me, there will be the ability to throw out of our country much more rapidly people who threaten us and our way of life."

Asked whether a Conservative-only administration would be needed to deliver these changes, because Liberal Democrats would prevent him in a coalition, Cameron replied: "Yes."