GERMANY has a complicated relationship with military force, for reasons that are more than understandable. But what is one to make of its contortions over the intervention in Libya?

One moment Germany is Europe's most awkward critic of the air campaign to save Benghazi; the next it is first to put up its hand to volunteer forces, including the despatch of ground troops if necessary, to deliver humanitarian aid to Misrata.

So are we about to see the return of German troops to North Africa for the first time since the defeat of Erwin Rommel's Afrikakorps in the second world war? Maybe.

The German government has taken a decision in principle to take part in a humanitarian mission as part of an EU force, should the UN ask for assistance to deliver aid. This is a remarkable turnaround from the country that, rather than vote with its European partners - France and Britain - chose instead to side with China and Russia in abstaining in the UN Security Council vote to authorise military action. Worse, it then withdrew its ships from a NATO mission to enforce the UN-mandated arms embargo on Libya.

That was all before the state elections in Baden-Württemberg, which Angela Merkel's ruling coalition lost in any case. Now her spokesman declares that “if a request were made to the EU, Germany would live up to its responsibilities”.

Germany draws a distinction between the current NATO-led combat mission and the putative EU-led humanitarian mission (little matter that both would be justified under the same UN resolution authorising military action to protect civilians). Partly for lack of means and partly because of divisions within the EU, the union has been kept out of main military action in Libya, commanded initially by an American-led coalition before being handed over to the transatlantic alliance.

But last week the EU quietly decided to set up a military headquarters in Rome to run a possible humanitarian mission (even though NATO has also done contingency planning for such an eventuality). For now, say senior European officials, this is just a precautionary step, to be ready to act quickly should it be needed. The operation would only be activated if the UN asks for help.

Whether such a request will be made, and precisely in which context, is unclear. Humanitarian folks try to avoid mixing too much with military types for fear of being identified as combatants. That said, the EU operation already has a name, “EUFOR Libya”, and Italy's Rear-Admiral Claudio Gaudosi has been appointed to head it.

The most pressing need in Libya is to help the besieged population of Misrata, where rebels have repulsed repeated attempts by loyalists of Muammar Qaddafi to take the town centre. The UN humanitarian chief, Valerie Amos, this week expressed alarm about the conditions in the city of about 300,000 people. “The situation on the ground is critical for a large number of people who immediately need food, clean water and emergency medical assistance," she said.

A Turkish ship made a quick dash to Misrata this week to evacuate wounded Libyans. But plainly the city needs a more sustained aid effort. The UN has called for a “temporary cessation of hostilities” to allow it to evacuate foreign workers and Libyans who want to leave. But what if a ceasefire is not forthcoming? Then the port may have to be secured by outsiders.

This is where German troops may be called upon to intervene. The EU is supposed to have two battlegroups, contingents of about 1,500 troops ready to deploy at a few days' notice. Germany contributes about 800 men to one of the battlegroups currently on the roster. A German military source yesterday said they could be ready to deploy within ten days.

But what about all those assurances that there would be no boots on the ground? Well, UN Security Council resolution 1973 bans the intervention of an “foreign occupation”. This suggests that other types of forces short of occupying troops may be legal, not least because the same resolution authorises the use of "all necessary means" to protect the civilian population.

British officials have already been using this argument to justify the possible deployment of trainers to help organise the rebels, be they serving soldiers (eg, from an Arab country) or even private military contractors, and perhaps even of forward air controllers to direct air attacks more accurately.

The EU agrees that there is some flexibility in the resolution. Who would judge its limits? The UN, says one EU senior source: if it asks for boots on the ground then the deployment of ground forces must be, by definition, legal.

The EU has felt sidelined in the military phase of the Libya crisis (it has been the main forum to discuss sanctions). It has long wanted to develop more muscular military capabilities, but has been repeatedly thwarted, especially by Britain. Now it thinks that, precisely because it has a softer and less martial reputation, it may be ideally placed to help out in Misrata. “Until recently everybody thought European defence was dead,” says one senior source, “But now it may be rising from the ashes.”

It would be a cruel irony if Germany, in its attempt to restore its battered credibility among its allies, were to expose its forces to greater danger on the ground in Misrata than if it had taken part in the air or maritime operations to begin with.