After decades of conflict, Iraq is seeking to reclaim a leadership role and status in the Arab world with a centrist policy and a determination among the country's top leaders to maintain good relations with both Iran and the United States.

A flurry of recent diplomatic activity and high-profile visits to the Iraqi capital, including this month's re-opening of a Saudi Consulate in Baghdad - for the first time in nearly 30 years - points to a new era of openness as the nation sheds its war image and re-engages with the world.

"Iraq is coming back to the neighbourhood," President Barham Salih told The Associated Press in a nearly hour-long interview last month. The veteran politician laid out a vision centred on an "Iraq First" policy, saying his country can no longer afford to be caught in regional disputes.

"For almost four decades Iraq was the domain in which everybody pursued their agenda at the expense of the Iraqi people. It's time we say we need a new political order ... in which Iraq must be an important pillar," Salih said.

Iraq has emerged from a ruinous three-year war against the Islamic State group and faces the mammoth task of reconciling, rebuilding and returning tens of thousands of displaced to their homes. And while the extremists' territorial "caliphate" has been defeated in Iraq and Syria, the militants have now shifted to an insurgency campaign of targeted assassinations, car bombings, and suicide attacks.

Challenging authority

The issue of Iran-backed Shiite militias who fought ISIS alongside Iraqi security forces poses a challenge to the government's central authority, and the country's oil-based economy is suffering from wide-scale corruption.

"Iraq's path to reclaiming a leadership role in the Arab world will depend on how successful its leaders are in tackling security and economic challenges at home," Randa Slim, a senior fellow at the Washington-based Middle East Institute wrote recently.

Amid rapidly escalating tensions between the US and Iran, Iraq also needs to maintain a delicate balance with the two as Baghdad has strong ties with both countries.

The dynamics are complex. The Shi'ite-majority country lies on the fault line between Shi'ite Iran and the mostly Sunni Arab world, led by powerhouse Saudi Arabia, and has long been a theater in which Saudi-Iran rivalry for regional supremacy played out. Relations have been particularly frosty with Riyadh, which broke relations with Baghdad following Saddam Hussein's invasion of Kuwait in 1990 and never really warmed much as Iraq was increasingly pulled into Iran's orbit in later years.

Iraq needs much help and investment to rebuild its cities - something it can only get from oil- and gas-rich Gulf countries, including Saudi Arabia. But it can also ill afford to alienate Iran, which holds enormous political and military sway in Iraq through powerful militias and pro-Iran politicians.

"We have 1 400km of borders with Iran, we simply cannot ignore that reality," Salih said, adding that it's in Iraq's national interest to nurture good relations with Iran, with which Iraq fought an eight-year war in the '80s. He said Iraq, however, was also keen on good relations with Turkey, Saudi Arabia and other regional countries.

Closer ties

Mindful of the need to counter Iran's growing influence in the region in the post-ISIS order, Saudi officials have sought closer ties with Iraq, and last week sent a high-level delegation to Baghdad where the kingdom's consulate was inaugurated.

The Saudi delegation's visit followed a trip to Baghdad last month by Iranian President Hassan Rouhani during which the two sides signed several agreement designed to boost bilateral relations.

It's a stark contrast from past years when Baghdad was shunned and isolated, first because of international sanctions after Saddam Hussein's 1990 invasion of neighboring Kuwait, and later, after the US-led invasion that toppled him, when Iraq sank into cycles of sectarian bloodletting.

Amid the violence, international dignitaries avoided visits to the Iraqi capital, and when they did, made them brief and unannounced for security considerations.

In 2007, UN chief Ban Ki-moon famously ducked behind the podium during a live press conference with the prime minister at the time, Nouri al-Malki, as a rocket slammed outside the building.

Now, Iraqi leaders say their country is not part of any regional conflict.

Prime Minister Adel Abdul-Mahdi in his first foreign trip last month traveled to Cairo to meet with Egyptian President Abdel-Fattah el-Sissi. They were joined by Jordanian King Abdullah II for a tripartite summit on measures to strengthen economic cooperation. On Tuesday, Abdul-Mahdi announced he will soon be visiting Saudi Arabia to sign several agreements.

Some are even suggesting that Iraq could play a mediating role between regional foes.

Lebanon's parliament Speaker Nabih Berri, on a visit to Baghdad earlier this month, said Iraq is a unique position to play an important regional role "in the reconciliation between the kingdom of Saudi Arabia and the Islamic Republic of Iran".

Watheq al-Hashemi, an Iraqi political analyst, said it's an opportunity for Iraq to again become an important regional player.

But for that to happen, Iraqi politicians "need to put country before sect and act as statesmen", something he says they've had trouble doing for a long time.