17/01/2016 8:16 AM AEDT | Updated 15/07/2016 12:51 PM AEST

Prime Minister Malcolm Turnbull Makes Surprise Visit To Iraq To Discuss Islamic State And Meet Aussie Troops

Iraqi security forces clear the Soufiya neighborhood of Islamic State fighters in central Ramadi, 70 miles (115 kilometers) west of Baghdad, Iraq, Thursday, Jan. 14, 2016. More than two weeks after central Ramadi was declared liberated, Iraq's counter terrorism forces are slowly battling pockets of Islamic State militants on the northeastern edges. Commanders on the ground say roadside bombs, bobby-trapped houses and the militant group's use of civilians as human shields are the main factors slowing their progress. (AP Photo/Khalid Mohammed)

The Prime Minister Malcolm Turnbull has visited Baghdad for a surprise meeting with Australian troops and to hold talks with the Iraqi government.

Mr Turnbull met with Iraqi Prime Minister Dr Haider Al-Abadi to discuss the current security situation in Iraq, Iraq’s military campaign against Islamic State, and the humanitarian situation in the country.

“We are strongly committed to helping Iraq in its fight against Daesh. Daesh is a threat to all of us and we need to continue to work together to defeat these terrorists,” Mr Turnbull said after meeting with Dr Al-Abadi.

He said that the victory against Islamic State needed to be one that “endures” and called for reconciliation between different groups in Iraq.

“There needs to be a solution, an outcome, a reconciliation in Syria. Borders are of course just lines on the map. Unless there is an end to the war in Syria, it will be challenging to maintain the peace in Iraq as we discussed.”

The prime minister was mobbed for selfies on his visit to Camp Baird, Australia's national command and support base for the Middle East region.

His first visit to the region as leader was well received by Australian defence force members who are making the second-largest contribution to the fight against Islamic State in Iraq behind the United States.

“You really do us proud and you are doing vitally important work, not just for Iraq, not just for the region, but for the whole world. We have a global struggle against terrorism and you are in the front line,” Mr Turnbull said.

He also visited Taij military base, where Australian and New Zealand soldiers are training local forces.

Mr Turnbull said Australia was encouraging other European countries to make a greater contribution to military commitment in the region.

He also stressed the importance of local soldiers.

"The most important boots on the ground are Iraqi boots," Mr Turnbull told troops.

"On the ground, they have to win back their own country. They have to reach the political settlement and reconciliation with their own people."