A moral impulse to help save someone doesn’t always go as planned – which is just the type of plot twist that makes fiction writers wealthy. The protagonist often ends up on shaky moral ground.

In Libya, the reality of war may be heading for such a plot-twisting moment.

President Obama justifies the US military role there as necessary to avoid “a massacre that would have reverberated across the region and stained the conscience of the world.” And, he says, only air power is needed to save civilians – with no military boots on the ground. The goals and means are limited.

But as the conflict drags on, and the forces of Muammar Qaddafi infiltrate various cities to kill more civilian opponents, the lines of fighting are becoming blurred.

And so, too, is the morality of the foreign intervention. A “responsibility to protect” could easily become a necessity for military victory.

The US and other members of the UN-backed coalition may face a moral dilemma soon: Will foreign forces ultimately need to use ground forces to capture or kill Qaddafi – an act that Obama and others now find repugnant – in order to achieve the goal of protecting civilians?

That type of question is already being addressed in another conflict on the African continent, one that is fast nearing its own dramatic denouement. It may serve as a lesson in Libya.

In Ivory Coast, a former French colony that has been the world’s top cocoa producer and was once the jewel of West Africa, French and United Nations forces have shifted tactics in recent days. They are no longer simply protecting civilians in a violent conflict that arose over who won a presidential election last November.

Now they are actually helping the forces of the widely recognized election winner, Alassane Ouattara, win the military fight.

In fact, with the direct aid of some 1,700 French soldiers and 2,250 UN “peacekeepers,” Mr. Ouattara’s forces have surrounded the presidential compound of the incumbent leader, Laurent Gbagbo, in the commercial capital of Abidjan.

Mr. Gbagbo refuses to surrender. Some 200 fighters with him inside his well-armed redoubt are still shooting up the area. And another 800 Gbagbo forces are still killing civilians in the city and may continue to do so until he is captured or killed.

The French have all but obliterated Gbago’s heavy armaments that protect him. Negotiations appear stalled, and now the question is whether Ouattara-loyal forces will make the final blow. Their ability to do so will only be possible with the aid of French or UN forces nearby.

Might the Libyan conflict end up like this, with the need to violently end Qaddafi’s total control for the sake of ending further harm to civilians?

“If Qaddafi stays behind, not only will the Libyans be victimized; all of us will be victims,” says Ali Aujali, Libya’s former ambassador to Washington and a representative of the rebels. “It is time for us now to get rid of this man.”

Ivory Coast, also known as Côte d’Ivoire, shows how mission creep can lead to morality muddle.

In Libya, NATO’s air-only campaign has tried to hit the tanks and artillery of Qaddafi forces hidden inside cities, but without an end to the slaughter of civilians. Only a third of Qaddafi’s ground forces have been destroyed. “We should be taking the fight to Tripoli,” says one US senator, Republican Lindsey Graham.

Like quicksand, this war may yet drag the US in deeper. The entry to the war could end up being so much simpler than the exit.

A limited humanitarian mission, sanctioned by the UN just as the foreign fighting in Ivory Coast also is, may yet compel the West to send in foreign ground forces or, at least, arm Libyan rebels, if that humanitarian impulse is to remain genuine.

The “fog of war” can sometime fog up the original reasons for a war. Regime change and civilian protection may end up being two sides of the same coin.