As the year comes to a close, these are the top five events that helped shape Iraq in 2014:
The Islamic State of Iraq and the Levant, a splinter Al Qaeda group, said it established a "caliphate" in Iraq after taking over Mosul, Iraq’s second-largest city, in June.
ISIL was advancing so quickly that some analysts predicted the terrorist group would enter Baghdad before the year's end. Clashes between ISIL militants on one side and Iraqi security forces and Kurdish Peshmerga fighters on the other, left the country in turmoil.
Although ISIL was able to seize control of a number of areas in northern and western Iraq, the group was unable to make it as far as Baghdad.
The security vacuum, created by the fighting, forced many families to flee their homes in the provinces of Diyala, Al Anbar, Saladin and Ninawah. Iraq's Ministry of Immigration and Migrants said the number of internally displaced people in the country reached 470,000 in 2014.
2. Al-Maliki steps down, Abadi forms new government
After failing to stop ISIL's advance and the inability to establish a unity government, Nouri Al-Maliki, who had been prime minister since 2006, stepped down in August. His decision came after immense pressure from other Shiite politicians, Shiite religious leaders, Iran and the U.S.
Iraq's President Fuad Masum asked Haidar al-Abadi, deputy parliamentary chairman, to form the government. Many analysts see al-Abadi's policies as more inclusive. The U.S., Turkey and Iran, as well as Iraqi Kurdish, Sunni and Shiite groups welcomed al-Abadi’s nomination.
3. Turkish-Iraqi relations back on track, 'coldness' over
Iraqi PM al-Abadi paid a visit to Turkey in December, meeting with President Recep Tayyip Erdogan and PM Ahmet Davutoglu in a gesture that Turkish-Iraqi relations were getting back on track after being tense during al-Maliki's tenure.
In a televised interview, Turkish FM Mevlut Cavusoglu said the situation was tough during al-Maliki's time in office.
"Every little thing evolved into an issue and a problem during Maliki's term," he said. "Now that the coldness between Turkey and Iraq is over, we will accelerate our relations in every possible way."
During his visit, al-Abadi said his country shares economic and security ties with Ankara. Davutoglu said the countries' defense ministers agreed to make more comprehensive efforts in training Iraqi security forces in their fight against ISIL.
Davutoglu also said Turkey was ready for any kind of cooperation to help direct Iraq's rich energy resources into the world market. Al-Abadi said Iraq wants its oil to reach the global market via Turkey.
4. American journalist James Foley beheaded
The beheading of James Foley, an American freelancer journalist, in August, left the world in shock.
ISIL released video footage showing Foley on his knees next to an ISIL militant, who blamed the U.S. and President Barack Obama for "denying Muslims the right to live under the caliphate."
Foley went missing in Syria in late 2012 while working for the Boston-based Global Post.
His final words were: "I wish I had more time, I wish I could have the hope of freedom and seeing my family once again, but that ship has sailed."
Since then, ISIL has executed at least four other Western hostages: Steven Sotloff, David Haines, Alan Henning and Peter Kassig.
5. Erbil, Baghdad resolve oil dispute
PM al-Abadi and the Kurdish Regional Government's PM Nechirvan Barzani reached an agreement that allows the Kurdish region to export 250,000 barrels of oil per day and Kirkuk province to produce 300,000 barrels per day.
The agreement will come into effect on Jan. 1, 2015, putting an end to a problem that has, for years, almost left both governments bankrupt.
As part of the deal, Baghdad will allocate 17 percent of Iraq's oil budget to the Kurdish region. The Baghdad government had halted payments to the region after its move to sell Kurdish oil independently on the world market.