A picture taken through a hole on a building shows Fallujah after Iraqi forces retook the embattled city from the Islamic State group on June 26, 2016. Photograph: (AFP)
A timeline of events from the breakthrough by IS fighters in 2014 to the latest government counter-attack
Iraqi forces raised Friday the national flag over the government compound in Fallujah nearly four weeks into an offensive to rout the jihadists from their main Iraq bastion.
The following is a timeline of events from the breakthrough by IS fighters in 2014 to the latest government counter-attack.
2014: Jihadist breakthrough
On January 4, Iraq loses its first key town since the US-led invasion of 2003. Fighters of the Islamic State of Iraq and the Levant and their allies capturing Fallujah and parts of Ramadi, west of Baghdad.
The vast Anbar province that surrounds the two towns is predominantly Sunni Muslim and fiercely resisted US troops when they occupied Iraq.
On June 9, the jihadists capture Mosul, the second largest Iraqi city in the north and declare an Islamic caliphate on June 29, calling itself the Islamic State group.
The jihadists also control Tikrit, home town of executed dictator Saddam Hussein north of Baghdad, and large parts of the country up to Iraqi Kurdistan. IS drives out tens of thousands of Iraqi Christians and Yazidis, a Kurdish-speaking non-Muslim minority that lives around Sinjar near the border with Syria.
On August 8, the United States launches air strikes against IS and a month later has created a coalition to target the group in Iraq and Syria.
On March 31, Iraqi troops and Shiite militias backed by neighbouring Iran recapture Tikrit.
By May 17, however, IS completely controls Anbar provincial capital Ramadi which stretches west to Syria where IS has declared a de-facto capital in Raqa.
Later in the year, Iraqi forces and coalition air strikes begin driving IS back, and by mid-October they have recaptured Baiji and its strategic refinery north of Baghdad.
Kurdish forces backed by air strikes recapture Sinjar on November 13, severing an IS supply route between Iraq and Syria. Coalition strikes intensify after November 13, when attacks claimed by IS kill 130 people in France.
On December 27, Iraqi forces say they have liberated Ramadi, their biggest victory against IS to date. But the city is not totally cleared until February 9, 2016.
2016: Fallujah and Mosul
The government focuses on recapturing Fallujah and Mosul, IS's last strongholds in Iraq.
In April, Washington says it will send attack helicopters and another 200 soldiers to train and assist Iraqi troops, bringing the total number of US military personnel in Iraq to more than 4,000.
On March 24, the army and allied militia begin an offensive in the northern Nineveh province around Mosul, making slow progress. On May 29, Kurdish peshmerga fighters backed by the international coalition recapture several villages east of Mosul.
To the south, coalition-backed Iraqi troops begin to squeeze Fallujah in March and capture Heet and Rutba, towns which control supply routes between Iraq and Syria.
On May 22-23, they begin an offensive to retake Fallujah, where an estimated 50,000 people still live.
IS strikes back with suicide attacks in Baghdad and elsewhere, but is now estimated to control just 14 percent of Iraq, down from a peak of 40 percent in 2014.
On May 30, elite troops begin a three-pronged dawn assault on Fallujah city.
On June 17, they raise the Iraqi flag above the main government compound. Operation commander Lieutenant General Abdulwahab al-Saadi says 70 percent of the city has been liberated.
The loss of Fallujah -- which lies just 50 kilometres (30 miles) west of Baghdad -- would leave Mosul as the only major Iraqi city under IS control.