President Obama hugs French President Nicolas Sarkozy during a ceremony in Cannes celebrating the long friendship between their two nations. (REUTERS/Lionel Bonaventure)

Obama stood patiently, raindrops pelting his dark suit, as a French military choir sang, first, “La Marseillaise,” the French national anthem, and, second, the “Star-Spangled Banner.”

At last, Obama moved under a white canopy as his counterpart, French President Nicolas Sarkozy, introduced him to a crowd of dozens of uniformed military service members from both nations and poncho-donning French citizens.

“You are President Obama, who means hope for the entire world,” Sarkozy said in French. “You have many friends here.”

The soaked crowd, who were forced by security guards to relinquish their umbrellas, cheered. For a brief moment, Obama could put aside his relentless domestic political problems and the prickly European debt crisis that had consumed his two days here at the Group of 20 summit.

For half an hour, Obama was commander-in-chief, celebrating a U.S.-France military partnership that stretched back generations — to Normandy, and back further still to when the French helping Colonial forces in battles at Yorktown, as Sarkozy noted in his remarks.

“Each time an American soldier dies on the other side of the world,” Sarkozy had said, “our French hearts miss a beat. We feel solidarity with American troops and families.”

Assuming the lectern, in front of a grand war memorial called the Monument aux Morts, Obama said: “I understand clearly the affection with which you’ve once again described our alliance and the friendship between our peoples. So, thank you, Nicolas, my partner, mon ami.”

The ceremony was arranged by Sarkozy to celebrate the alliance and their joint achievements in working with NATO to help Libyan rebels oust longtime dictator Moammar Gaddafi. But it was also a way for the French head of state, who like Obama is facing a difficult reelection bid, to draw some political strength from his American counterpart, who retains a personal popularity here.

Sarkozy, whose hopes for a grand G-20 summit full of big ideas and accomplishments was dashed by the Greek debt crisis, had scheduled three public appearances with Obama, including a joint interview on French television. One poll Friday showed Sarkozy had achieved a six-point bounce in public approval ratings this week.

For his part, Obama, who has been politically battered for months over his handling of the U.S. economy, could focus on his foreign policy achievements, which have in many ways outshined his domestic performance. No matter that most of the White House press corps had opted to skip the event, which came after a more sober Obama news conference, during which the first question was about his tough re-election path.

“The United States was proud to play a decisive role, especially in the early days, taking out Libyan air defenses and conducting precision strikes that stopped the regime in its tracks,” Obama said. “But at the same time, this mission showed us why NATO remains the world’s most effective alliance. We acted quickly, in days -- the fastest mobilization in NATO history.”

Obama didn’t stop there. Having announced last month that all American forces would leave Iraq by year’s end, and with the United States reportedly considering a faster drawdown of force in Afghanistan, the president aimed bigger. He called this a new era.

“After a difficult decade, the tide of war is receding,” Obama said, subtly casting his foreign policy agenda in contrast to that of his predecessor, George W. Bush. Other nations, Obama emphasized, would help the United States maintain peace and freedom.

The role of France and NATO “showed more nations bearing the burdens and costs of peace and security. And that’s how our alliance must work in the 21st century,” he said.

Winding up his remarks, the president noted that on one side of the White House was the Washington Monument and on the other a statue of Rochambeau, a French soldier who had helped the colonialists in the Revolutionary War.

Quoting from an inscription on the statue, Obama said George Washington once told Rochambeau: “We are fellow laborers in the cause of liberty, and we have lived together as brothers should do -- in harmonious friendship.”

And with that, Obama and Sarkozy left the stage, shook hands with an enthusiastic public and walked into city hall to tell their buddy story on the airwaves.