Deep unease about military action against the regime of Muammar Gaddafi was voiced on both sides of the House of Commons yesterday as a series of MPs registered reluctant support for Britain's involvement in the campaign.

In contrast to David Cameron and Ed Miliband, who voiced strong support for the action, Conservative and Labour backbenchers warned of the dangers of Britain's third major military campaign in a decade and spoke out against the media for romanticising the horrors of war.

The concerns were raised in the Commons as the foreign secretary, William Hague, was told in private of deep fears among Conservative MPs about the possible length of the military campaign. Tories who had threatened to challenged the prime minister during his speech, ended up registering their concerns in the Commons by putting pointed questions to Miliband as he offered strong support for the government.

Kris Hopkins, a former soldier who was elected as Conservative MP for Keighley last year, was heard in near silence as he said that Britain, the US and France were struggling to find the moral high ground for military action.

Warning of a lack of political capital after the "illegal war" in Iraq and the "folly" of the Afghan war, Hopkins said: "There may be moral reasons to fight again. But I will be honest with you. I think we are struggling to find a moral high ground in which to project that morality."

Hopkins was highly critical of Arab leaders for failing to speak up as western countries confront an enemy. "While we wage war on our enemy, Muslim brothers and Arab leaders – with a few exceptions – remain silent. It's more convenient for the infidel to kill your Muslim brother and gesture disapproval than stand up to a tyrant.

"To the new leaders of the emerging democracies out there in the Middle East, I say to you, the next time a murderer comes to the end of his reign, you gather in your house like we are today and think about how you are going to take your share of the responsibility."

Hopkins was also critical of the media for romanticising war. "There is nothing glorious in war, there is nothing romantic about it. I would say to some members of the media who have portrayed some form of entertainment about what is going on is just not right. I'm afraid human beings need to commit brutal, savage attacks on each other to win wars."

But Hopkins, who served in Kenya, Northern Ireland and Germany, said he would support the action after the prime minister won UN backing. Cameron made a point of walking up to Hopkins after his speech to congratulate him in person.

Bob Ainsworth, Labour's last defence secretary, was the most senior figure to raise concerns. He said: "I am a late and very reluctant supporter of these operations. That is not because I have become a pacifist overnight. It is because it is relatively easy to support things on day one and relatively difficult to support them a month through or month nine."

Rory Stewart, the Tory MP for Penrith and the Border who was deputy governor of an Iraqi province, said: "It is very easy for us to say today so far and no further. But all the lessons of Afghanistan is that if you dip your toes in you are very soon up to your neck."

Ben Wallace, the Tory MP for Wyre and Preston North who served in the Scots Guards, warned of the dangers of failure. "What we do with Libya will ripple right through the Middle East. It may point the right direction and it may lead the Middle East into a more democratic liberal environment. If we get it wrong – and there is a high dam wall in all of this – then we could end up with a Middle East in the hands of Islamic fundamentalists. So I wish the prime minister and the foreign secretary well in all that they do to try and make sure it goes in the right direction. I think again it is time to play the great game that we used to play so well, rather than settle for tactical short-term policies we saw in the last 13 years."

The prime minister listened to much of the debate and took the rare step of intervening during backbench speeches. During his own speech he took questions from the veteran leftwingers Jeremy Corbyn, John McDonnell and Dennis Skinner. Skinner asked: "It is easy to get into a war, it's much harder to end it. When will all those nations that are taking part know what the circumstances are for pulling out and ending the war?"

Cameron said: "It is easier to start these things than to finish them. You should always be very cautious and careful. The answer to his question – when is this over – is when we have complied with and implemented the UN security council resolution. That is about protecting civilians, protecting life and giving the Libyan people a chance to determine their own future.

"This is different to Iraq. This is not going into a country, knocking over its government and then owning and being responsible for everything that happens subsequently. This is about protecting people and giving the Libyan people a chance to shape their own destiny."

Miliband spoke of the way his parents had survived the Holocaust – his late father Ralph escaped to Britain while his mother Marion was shielded in Poland – as he supported the action.

"Today's debate is conducted in the shadow of history of past conflicts. It is also conducted for me in the shadow of my family's history as well. Two Jewish parents whose lives were changed forever by the darkness of the Holocaust yet who found security in Britain. This is a story of the hope offered by Britain to my family.

"But many of my parents' relatives were out of reach of the international community and perished as a result. In my maiden speech in this House I said I would reflect the humanity and solidarity shown to my family more than 60 years ago.

"These are the kinds of things we say in maiden speeches but if they are to be meaningful we need to follow them through in deeds, not just words.

"That is why I will be voting for this motion tonight and that is why I urge the whole house to vote for this motion."