French President Francois Hollande has met French soldiers in Iraq and told them their work against so-called Islamic State (IS) is helping to prevent terrorism at home.
Mr Hollande is due to discuss the anti-IS fight with senior Iraqi officials.
He is the most prominent head of state to visit Iraq since a US-led 60-member coalition began air strikes against IS.
France's defence ministry says its aircraft have destroyed more than 1,700 targets since joining in 2014.
As part of the coalition there are 500 French soldiers in Iraq, advising local forces.
French special forces are believed to be involved in the battle to drive IS militants out of Mosul, the group's last major stronghold in Iraq.
That offensive began in October and forces launched a fresh push within the last week. They said they had opened new fronts in the city.
"Taking action against terrorism here in Iraq is also preventing acts of terrorism on our own soil," Mr Hollande said at a base of Iraq's elite Counter-Terrorism Service near Baghdad.
Mr Hollande is travelling with French Defence Minister Jean-Yves Le Drian.
He is scheduled to meet Iraqi Prime Minister Haider al-Abadi, President Fuad Masum and Parliament Speaker Salim al-Juburi later on Monday.
A source in the French presidency told AFP news agency that Mr Hollande would draw attention to the question of what to do after IS's defeat, saying he would "stress the importance of continuing efforts to ensure sustainable security in the country after Daesh (IS) has been defeated and the coexistence of communities in a united and sovereign Iraq".