US President Barack Obama on Thursday told the French people Americans would "stand united" with them in the fight on terror, as he offered condolences over the deadly Charlie Hebdo attack.

"Vive la France!" Obama wrote in a book of condolence in a surprise visit to the French embassy in Washington, one day after the attack in Paris that left 12 dead and sparked a huge manhunt for the two suspected gunmen.

"On behalf of all Americans, I extend our deepest sympathy and solidarity to the people of France following the terrible terrorist attack in Paris," Obama wrote.

"As allies across the centuries, we stand united with our French brothers to ensure that justice is done and our way of life is defended," he added, according to the White House.

"We go forward together knowing that terror is no match for freedom and ideals we stand for -- ideals that light the world. Vive la France!"

After signing the book of condolence, Obama observed a moment of silence before shaking hands with French ambassador Gerard Araud.

"I told President Obama that we were deeply moved by the reactions of the American people, by all the expression of grief and support we received," Araud wrote on Twitter shortly after the US leader's visit.

Araud welcomed Obama's signing of the book of condolence as "a moving and highly significant gesture."

"The French are grateful," he wrote.

Wednesday's bloody attack in Paris has triggered an outpouring of support across the United States, with many cities staging impromptu vigils for the victims.

France is America's oldest ally, with the transatlantic partners having established diplomatic ties in 1776.