BY MOST measures, the Arab uprisings ought to have given France a chance to show off its diplomatic prowess. The former colonial power in Tunisia (and Morocco and Algeria), France has long claimed a special understanding of the Arab world, the ancestral home of millions of its citizens. Nicolas Sarkozy talked early in his presidency of the need for Europe to reach out to countries on the Mediterranean's southern rim. And Mr Sarkozy is presiding over the G20 and G8 clubs, lending him a platform for leadership. Yet France has veered from complicity to confusion.

It took until this week for Mr Sarkozy to begin repairing the damage by dismissing Michèle Alliot-Marie, his foreign minister, and reorganising his diplomatic team. Ms Alliot-Marie had become a liability. In January she offered the know-how of French security forces in crowd control to the Tunisian regime only days before the president fled. And it then emerged that, when holidaying in Tunisia over the new year, she had flown twice on a private jet belonging to a local tycoon who had links to the regime—and to her parents via a property deal. Mr Sarkozy tried to shrug all this off, having reshuffled his team only recently. But it became impossible for the foreign minister to do her job. Last week the president sent Christine Lagarde, the finance minister, to lead a delegation to Tunisia, with Ms Alliot-Marie kept at a safe distance in Brazil. Such absurdities were not sustainable for very long.

On February 27th Mr Sarkozy announced both “a new era” and a new foreign minister, Alain Juppé. This marks quite a comeback for the Gaullist former prime minister, who has already led the foreign ministry once in the early 1990s. In 2004 Mr Juppé was banned from political life for a year and given a 14-month suspended prison sentence, for political corruption linked to a fake-jobs scandal at the Paris town hall when Jacques Chirac was mayor. Although he was an unloved prime minister in 1995-97, he earned sympathy for carrying the can for Mr Chirac, who himself faces trial in a linked corruption case next week. France likes to recycle its politicians and, since he returned from a year in self-imposed exile in Canada, Mr Juppé has slowly rebuilt his career. Last year Mr Sarkozy brought him back as defence minister. This week, in a statement that did not refer even once to Ms Alliot-Marie, Mr Sarkozy described him pointedly as “a man of experience”.

Up to a point, foreign policy will remain in the president's hands, as it always has under France's fifth republic. But Mr Juppé has won himself a bit more freedom than his predecessors had. In this week's mini-reshuffle, and reportedly as a condition set by Mr Juppé, Mr Sarkozy made Claude Guéant, chief of staff at the Elysée, interior minister in place of Brice Hortefeux, who becomes a presidential adviser. This rids Mr Juppé of a source of rivalrous parallel diplomacy, since Mr Guéant ran a network of personal contacts in Africa and the Arab world from the Elysée.

The diplomats now hope to turn the page on what one admits “has not been our finest hour”. France was tardy in Tunisia and wavered over Egypt. One poll finds that 81% of respondents think France's international role has weakened. An anonymous group of diplomats wrote in Le Monde a week ago that “France's voice in the world has disappeared” and its “foreign policy is dictated by improvisation”.

Already, the response to events in Libya has been nimbler. In 2007 Paris was shut down to welcome Colonel Muammar Qaddafi and his entourage; he was allowed to pitch his tent in a garden next to the Elysée. By contrast Mr Sarkozy has called the latest repression in Libya “revolting”, and called for sanctions. Mr Juppé was one of the first ministers in Europe to urge Colonel Qaddafi to quit. The prime minister, François Fillon, has sent two aid aircraft, carrying medical staff and supplies, to the rebel-held town of Benghazi.

France plainly does not want to find itself again so close to being on the wrong side of history. It helps that, as the uprisings have spread, French interests happen to align with their values. Mr Sarkozy has vowed henceforth to support “the values which are dearest to us, those of human rights and democracy”. Whether this means a lasting policy change is another matter. France has long been a big seller of weapons and fighter jets in the region, including (until now) to Libya. Other strongmen that Mr Sarkozy vowed to evict in democracy's name, such as Laurent Gbagbo in Côte d'Ivoire, have been forgotten.

A broader worry lurks in some minds. If France no longer seems to command the world's attention as it did a few years ago, could this be because it lost its singularity when Mr Sarkozy returned the country fully to NATO in 2009, reversing Charles de Gaulle's 1966 withdrawal from its military structure? The group of anonymous diplomats argued that “joined to the United States, as manifested by our return to NATO, we no longer interest anybody much because we have lost our visibility”. Two years ago, a certain Mr Juppé thought likewise, posing on his blog the question: “What advantage will we gain from losing this specificity?”

The argument is hard to disprove, or to disentangle from other factors, most notably a broad loss of influence for Europe and Mr Sarkozy's mercurial diplomatic style. By putting an end to its instinctive anti-Americanism, France has restored much-needed confidence in its transatlantic ties. This in turn helped to produce last year's Anglo-French defence agreement. It would be absurd, as yet another batch of anonymous French diplomats has argued in a surreal debate conducted in newsprint, to “return to a mythical past where France could exist only by opposing America”. Since 2009 two French generals have secured strategic NATO command posts. This seems to have been enough to satisfy Mr Juppé, at least. Referring to France's reintegration into NATO, he told Le Figaro recently that “in the end, the benefits outweigh the disadvantages.” Just days later, he was appointed foreign minister.

See also: Guttbye Guttenberg