MANILA, Philippines (UPDATED) – For 148 days, the city of Marawi was under attack by local terrorists known as the Maute Group.
It was a hard-fought 5-month battle. The military says 163 soldiers and policemen gave their lives for this valiant effort.
Let's look back at the government's actions and the military's challenges and triumphs to retake Marawi.
May 23 - The Maute Group attacks Marawi City and occupy public facilities. Its leaders pledged allegiance to the international terrorist network Islamic State or ISIS.
President Duterte cuts shorts his official visit in Russia and declares martial law in the entire Mindanao.
May 24 - Marawi bishop Edwin dela Peña reports that Father Teresito Soganub and at least 4 others were taken hostage by the Maute Group.
Duterte also names Armed Forces of the Philippines (AFP) chief General Eduardo Año as the martial law administrator.
Meanwhile, some lawmakers chide the government for either a supposed "failure of intelligence" or a "failure of coordination" in the Marawi clashes.
May 26 - Defense Secretary Delfin Lorenzana says the crisis will be over "in a week or less." (RELATED: Urban warfare still a challenge for soldiers in Marawi)
Meanwhile, Lorenzana admits to senators in a briefing that security officials did not recommend to President Duterte the declaration of martial law in Mindanao.
But Chief Presidential Legal Counsel Salvador Panelo later argues the declaration was the President's call, not that of security officials.
Duterte approves the creation of "peace corridors" with the Moro Islamic Liberation Front (MILF) to allow safe evacuation of Marawi residents, transport of goods, and retrieval of bodies.
May 30 - The Senate votes 12-9 to reject a resolution calling for a congressional joint session to tackle the martial law declaration.
Photo by Bobby Lagsa/Rappler
June 2 - AFP spokesman Brigadier General Restituto Padilla says the military will not meet Lorenzana's self-imposed deadline for security forces to end the Marawi siege.
Meanwhile, President Duterte expresses confidence that the siege will be over "in about 3 more days."
June 5 - The AFP announces that Duterte has put a P20-million combined bounty for Isnilon Hapilon and the Maute brothers Abdullah and Omar.
The Marines recover cash worth P52.2 million and checks amounting to P27 million in a house occupied by the Maute Group.
The Associated Press publishes a report about a video of terrorists planning the Marawi attack. The military confirms that the personalities in the video are Hapilon, the Maute brothers, and a certain Abu Humam. (READ: AFP chief Año details aborted Maute-ISIS 'grand plan' in Marawi)
June 7 - Justice Secretary Vitaliano Aguirre uses a photo to falsely tag opposition lawmakers in the Marawi crisis.
Meanwhile, former Marawi City Mayor Fajad Salic is arrested in Misamis Oriental for rebellion charges.
June 13 to 15 - The Supreme Court hears oral arguments on the petition against the declaration of martial law in Mindanao. (READ: SUMMARY: SC oral arguments on martial law in Mindanao)
June 18 - A woman suspected to be a sister of the Maute brothers is arrested in Iloilo City and flown to Cagayan de Oro City the next day.
June 28 - Duterte creates Task Force Bangon Marawi, headed by Lorenzana, via Administrative Order No. 3 to handle the rehabilitation of Marawi City.
July 6 - Duterte denies he would talk to Maute Group leaders, as claimed by a Muslim leader in a report.
July 11 - A Social Weather Stations (SWS) survey shows that majority of Filipinos back martial law in Mindanao, but oppose the planned expansion of its coverage to the entire Philippines.
July 14 - The Department of Budget and Management (DBM) says it is ready to release P5 billion in 2017 for the rehabilitation of Marawi City. P10 billion is also earmarked for 2018.
July 17 - Duterte verbally asks Congress leaders to extend martial law for another 60 days, still over Mindanao.
Congress will convene in a special session on July 22 – the end of the 60-day period – to tackle this request. (READ: Martial law extension won't lead to abuses – Lorenzana)
July 21 - The death toll among soldiers in the Marawi conflict breaches 100, as the government recaptures a crucial bridge in the city.
July 22 - Congress grants Duterte's request to extend martial law in Mindanao until December 31, 2017. (READ: Duterte wants martial law extension over 'evolving' urban warfare)
July 31 - In a report, military engineers begin construction of model houses at the designated relocation site in Marawi City. These houses will serve as "template" for about 5,000 temporary houses that will be built there.
Photo from JTF Marawi
August 3 - The Philippine Navy delivers military supplies and 7 tons of relief goods for Marawi City.
August 6 - Malacañang says the President has asked Congress to approve the recruitment of 20,000 more soldiers to tackle increased security threats following the Marawi siege.
August 8 - Lorenzana says there is "no need" and there are no talks for the United States military to conduct air strikes in Marawi City.
August 22 - The Mindanao State University (MSU) reopens in Marawi City. However, soldiers will still be deployed near the campus for security purposes.
August 28 - On National Heroes Day, President Duterte confers the Order of Lapu-Lapu (Kalasag) to 129 soldiers and policemen killed in Marawi.
August 30 - On Day 100 of the conflict, the military allows the media to cross Mapandi Bridge or Baloi Bridge, a crucial spot that the military has retaken a month prior.
Photo by Maria Tan/Rappler
September 1 - State prosecutors say they have dismissed rebellion complaints against 59 Muslim men in Zamboanga City. The 59 have been released after being suspected to be Maute rebels.
September 4 - The military reports that it has information Abdullah Maute was killed in an air strike last month.
September 5 - The Commission on Elections (Comelec) postpones the scheduled barangay and Sangguniang Kabataan (SK) elections in Mindanao due to the ongoing conflict in Marawi.
September 8 - The military says 5 Maute brothers have been killed, leaving Omar Maute as the only one left among the brothers in Marawi.
Joint Task Force Marawi also reports that the battle zone has been narrowed down to only 20 hectares.
September 9 - In a speech, Duterte asks the Maute Group to surrender. Earlier, he said he would rather have the terrorists killed than arrested.
September 10 - The military penetrates a "major defensive position" of the Maute Group in Marawi City after a "most difficult operation."
September 15 - Foreign assistance related to the Marawi conflict has reached P2 billion, reports Lorenzana.
September 16 - Father Chito Soganub is rescued from Maute Group kidnappers. (READ: Marawi priest Chito Soganub jokes: 'I am physically strong and handsome')
September 18 - The AFP says the battlefield is down to 10 hectares, but about 50 hostages remain in Marawi. "This will not last long, it is easier now," says AFP chief Año.
September 21 - In a press conference, Duterte says martial law in Mindanao will be lifted as soon as military clearing operations in Marawi are done.
September 22 - The battle zone shrinks further as the military closed in on a 3rd crucial bridge, the Masiu Bridge. (READ: Marawi generals cross critical bridges in battle area)
September 27 - Lorenzana declares he is "confident" the military will end the war in Marawi "by the end of the month."
Photo by Bobby Lagsa/Rappler
October 5 - Major General Rolando Bautista, the overall commander of military operations in Marawi, becomes the commanding general of the Philippine Army.
The next day, Bautista turns over Joint Task Force Marawi to Major General Danilo Pamonag, the officer who led military operations in the siege of Zamboanga City in 2013.
October 7 - Police arrest Aminkisa Macadato, reportedly a Maute Group funder, in Valenzuela City. Authorities share initial details of his capture on October 24.
October 17 - Duterte declares that Marawi City has been liberated. But AFP spokesperson Padilla says the war will continue "until armed elements are dealt with. But terrorists no longer have complete control." A total of 163 soldiers and cops sacrificed their lives to liberate Marawi. Meanwhile, 847 terrorists are killed by the military. (IN PHOTOS: 148 days of war in Marawi City)
The military says Mahmud helped finance the Marawi siege.
In a speech that night, Duterte tells Filipinos to stay alert and "be prepared for any eventuality" as the threat of terrorism persists.