Italy's leaders have not found themselves on the right side of history over North Africa's revolts. While Europe's leaders were calling for "meaningful ... Libyan-led dialogue" and condemning the violence on the streets of Tripoli, Italy's foreign minister Franco Frattini was pondering what might come after Col Muammar Qaddafi.
"Would you imagine to have an Islamic Arab Emirate at the borders of Europe?" he asked. "That would be a really serious threat." This from a serving member of Silvio Berlusconi's government, a prime minister who, even as the Egyptian people were rising up against Hosni Mubarak's 30-year rule, was praising Egypt's ex-president as "the wisest of men".
Fortunately, other European leaders have scented the jasmine and understood the public's mood rather better. Even Britain - a country that has not showered itself in glory over its dealings with Col Qaddafi's regime - has explicitly called for the Colonel to go.
The rest of Europe joined a unanimous United Nations vote to impose sanctions. By pushing for sanctions against the dying Qaddafi regime, Europe has shown it is willing to wield diplomatic force against Libya. Now to prepare for what comes next.
Over the past few years, Europe's relationship with Libya has largely been based on energy and migration, swelling the flow of oil and stemming the flow of immigrants.
Europe needs Libya's energy: according to figures from the International Energy Agency, it imports 85 per cent of Libya's crude oil. Libya is also a main staging post for refugees from sub-Saharan Africa desperate to make it to Europe. For too long, Libya has policed the border with Europe, brutally herding African refugees into camps and forgetting about them. This is Europe's problem, but Libya has played the guard without any oversight.
Neither the energy trade nor the migration challenges will change. But given the importance of just these two issues - migration and energy - to Europe, it would be understandable if the Continent's leaders let realpolitik rationalise their responses. If there is a lesson in the diversity of revolts still gripping the region, it is that security for some is no security at all. Doing what's right is often the same as doing what works, especially in the long term.
It is encouraging that this message is finally being heard in European capitals. Britain's foreign secretary William Hague called the Libyan crisis "an historic test" for the EU. "If we can succeed in bringing both more democracy and more stability to North Africa and to the wide Middle East then that would be the greatest achievement of the European Union since the enlargement of the EU."
That will be especially important in the direct aftermath of Libya's uprising. Col Qaddafi's regime cannot long survive the pressure being applied to it, from within and without. Whatever happens, the immediate aftermath is likely to be messy and incoherent.
Libya is not Egypt. Although wealthier and with fewer people, Col Qaddafi's long rule has brutalised Libyan society and ensured there are few surviving institutions to ease a transition. There is no organised opposition in Libya ready to take over and, unlike Egypt, no established middle-class.
In the hopefully brief chaos that follows, it will be too easy for European leaders to exert influence to protect their interests, deciding that as long as the flow of oil continues and the flow of migrants is stemmed, the rest is an internal Libyan problem. That would be a mistake. The EU will have to engage with whoever comes after, but it can shape that transition. Europe has a chance to be on the right side of history, to help the Libyan people gain their independence and thus secure a stable future for both shores of the Mediterranean.
Europe's experience should not be underestimated in this regard. As I wrote last week, Western Europe provided a model to the countries of Central and Eastern Europe after their liberation from communism. Building institutions and facilitating the transition to democracy post-1989 has been a success, one that will provide valuable lessons (if not necessarily a model) for Libya.
A significant reason for that success was the carrot of European Union membership. For the time being, that is off the table. Enlargement has been a mixed blessing for the Western European nations that dominate the EU and the union is struggling with the idea of admitting further countries.
The surrogate political framework has been the Union for the Mediterranean, in essence a club of the EU, Arab and North African countries and a few others, though this has faltered recently and may not have a future in its present state. Yet regardless of the nature of the ties, for Libya the expertise of European governments' machinery and access to its markets on preferential terms will be a sweetener to steer its new political order.
And the rewards to Europe will not simply be moral. An economically successful Libya would provide jobs and opportunities, not only for those North Africans already in Europe, but for Europeans too. There are already Spanish businessmen who commute to Morocco for work. There is good reason to believe Libya could fulfil a similar role, particularly for Italy.
Col Qaddafi is on his way out. What order comes next will probably get worse before it gets better. But Europe must not make the same mistakes it has made in the past. Rebuilding Libya will be difficult, for Libyans and for their neighbours, but Europe's stake is in Libya's human resources as much as its natural ones.