(UPDATED) Clashes between the military and local terrorist groups erupted in Marawi City this week, prompting President Rodrigo Duterte to declare martial law in all of Mindanao.

Below is a timeline of the skirmishes that have also left several soldiers dead and thousands of residents displaced.

WATCH: Gunfire heard relatively close to the Provincial Capitol in Marawi City. Distance of actual firefight | via @chiarazambrano pic.twitter.com/7BWDCZuSF4 — ABS-CBN News (@ABSCBNNews) May 25, 2017

TUESDAY, MAY 23

1:45 p.m. - A joint operation of the Armed Forces of the Philippines and Philippine National Police was launched in Marawi City to capture terrorist leader Isnilon Hapilon, AFP chief Gen. Eduardo Año said in an interview on ABS-CBN News Channel. Hapilon is believed to be the Islamic State’s (ISIS) leader in Southeast Asia.

2:28 p.m. - Firefight between government troops and the Maute group is heard by residents in Barangay Malutlut, Marawi City.

4:34 p.m. - A black flag was raised in front of the Amai Pakpak Hospital. The flag bore an ISIS logo.

6:10 p.m. - Police Supt. Lemuel Gonda, spokesperson of the Police Regional Office 10, confirmed the clashes in Marawi City. Based on an initial report, one cop was wounded in the firefight.

6:35p.m. - Police visibility in Cagayan de Oro downtown area heightened following the attack in Marawi City by alleged members of the Maute group.

Police said they will intensify checkpoints in Iligan City and in Talakag, Bukidnon which is a gateway route to Lanao del Sur to make sure the tension won't escalate.

Video courtesy of Cris Angelo Andrade.

7:28 p.m. - National Security Adviser Hermogenes Esperon said the AFP was in full control of the situation. Esperon said they were updating President Rodrigo Duterte, as reports arrive from the Philippines. He said the military has 4 injured soldiers.

9:13 p.m. - Senior Supt. Rolly Andaya, deputy regional director of PNP ARMM, confirmed that Dansalan College and Marawi City Jail were on fire. Andaya did not provide further details whether the buildings were deliberately torched by Maute members or set ablaze during the encounter.

Marawi city jail. Photo courtesy of React Marang.

Dansan College on fire. Photo courtesy of Arsad.

9:45 p.m. - In an interview with ANC Live, Año said the situation was under control and that 8 soldiers were injured.

11:00 p.m. – President Rodrigo Duterte declared martial law in entire Mindanao, effective 10:00 p.m., presidential spokesman Ernesto Abella said in a press briefing in Moscow.

Defense Secretary Delfin Lorenzana said 2 soldiers and one police officer were killed, while 12 others were wounded in ongoing clashes in Marawi City.

Lorenzana said the Maute group torched St. Mary’s Church, the Marawi City Jail, the Ninoy Aquino School, and Dansalan College.

WEDNESDAY, MAY 24

Reports said several teachers, a priest and about a dozen parishioners were taken hostage by the terrorist in different areas in Marawi.

AFP spokesperson Col. Edgar Arevalo meanwhile announced that the government has recaptured control of the Mindanao State University, Amai Pakpak Hospital, and the city hall.

The death toll from the skirmishes rose to 5, to include 3 soldiers and 2 policemen, Arevalo announced.

The official also denied that ISIS was working with the local terrorists.

The military also ruled out using air strikes to flush out the rebels.

Duterte arrived in Manila after cutting short his visit to Russia. He guaranteed that martial law will not be abused, but warned that he may extend the declaration up to Luzon if the terror threaT continues to spread.

A lull in the fighting also allowed residents to leave Marawi in droves while the military sent reinforcements to the city.

Government troops check a vehicle evacuating residents from their hometown of Marawi city in southern Philippines, as it drives past a military checkpoint in Pantar town, Lanao Del Norte, Wednesday. Romeo Ranoco, Reuters

THURSDAY, MAY 25

A firefight erupted near the town center anew before noon.

Government troops are seen during an assault on insurgents from the so-called Maute group, who have taken over large parts of Marawi City, Thursday. Romeo Ranoco, Reuters

After about an hour, the military launched surgical air strikes in 3 barangays in Marawi City to flush out some 30 to 40 remaining members of the terrorist Maute group as operations reached the third day.

Officials confirmed that the skirmishes have killed 13 Maute fighters, 5 soldiers and 2 policemen.