Britain is not trying to create a "perfect Afghanistan", Defence Secretary Philip Hammond has said.

But he said plans to hand over responsibility for security to the Afghan government by the end of 2014 were "on track".

He also confirmed military operations in Libya had cost £212m - less than was estimated at one stage.

Mr Hammond announced women were to be allowed to serve on Royal Navy submarines for the first time.

The first women officers will begin serving on Vanguard-class nuclear-powered submarines in 2013, to be followed by female ratings on both Vanguard and the new Astute-class submarines from 2015.

Mr Hammond said Nato was not seeking to create a Western democratic state in Afghanistan but simply to ensure terror groups could not use the country as a base in the future.

He also praised the operation in Libya which led to the overthrow of Colonel Gaddafi, and said it had been legal and necessary to avoid a "festering rogue state on Europe's borders".

In a speech to the Royal United Services Institute in London, Mr Hammond said: "The successful conclusion of the combat mission in Afghanistan is my first priority."

Mr Hammond said unpicking the Strategic Defence and Security Review "piece by piece" was not an option.

But the shadow defence secretary, Jim Murphy, said later: "Philip Hammond needs a plan for Britain's defences beyond cutting them. His job is not only balancing the books but defending the country and our interests overseas."

At the start of Britain's military intervention in Libya, the chancellor told MPs it was likely to cost tens of millions of pounds, raised to £260m by the MoD as the action continued over the summer.

But the final estimate of the additional costs has now been lowered.

The total of £212m, including £67m for replacing spent munitions, is all expected to be met from the Treasury reserve.

Mr Hammond said the Libya campaign showed forces could take on new commitments despite the cuts.

But he criticised the previous Labour government's "fantasy budgets" on defence, and said ministers had made short-term decisions which had meant British forces had led a "hand-to-mouth existence".

'Capability gaps'

"But the situation we face now - after the years of political failure to grip the problem - is that eliminating the black hole in the defence budget is the only way to sustain military capability over the long term.

"If we don't reshape now we won't be in a position to order new equipment in the future. Our challenge is to move from the fantasy budgets of the past to firm foundations for the future.

"This is a transition that is essential to the future of defence - but no-one should be under any illusion that it will be easy or pain-free."

Mr Murphy said: "Savings must be made and reform is necessary, but the government's plans have left capability gaps and funding uncertainty.

"The whole service community will be worried and will want to know what his plans for further reductions are and where they will fall."