"The elections were very, very successful," Sarkozy, who was accompanied by Bernard Kouchner, the foreign minister, told a joint news conference after meeting with Talabani.
"France believes in the unity of Iraq and the world needs a strong Iraq."
He said France can help Iraq with the economy, construction and much-needed electricity as well as training Iraqi security forces and diplomatic efforts.
Violence in Iraq is dying down after tens of thousands of Iraqis and more than 4,000 US soldiers died since the invasion in 2003.
But suicide and car bomb attacks remain common.
On Tuesday, a bomb attached to a car belonging to one of the guards of Adel Abdul-Mahdi, the vice-president, exploded near a hospital and less than half a mile (one kilometer) away from the French embassy in central Baghdad, police said.
One aguard and two bystanders were wounded, they added.
Sarkozy's visit was shrouded in secrecy.
The last high-level visit to Iraq by a French official was in May 2007 when Kouchner spent a few days in Baghdad, in a sign of what Paris said was a renewed commitment to the country despite its staunch opposition to the US-led war.