Baghdad (AFP) - Iraq is building a three-metre-high security wall and trench defences around Baghdad in an effort to thwart jihadist attacks, a security official said on Thursday.

The aim is to prevent the infiltration of "terrorists" and car bombs into the city, Brigadier General Saad Maan said.

"We began constructing a three-metre-high (10 foot) concrete wall and a trench around the city of Baghdad," he told AFP.

Construction will take place in two phases, with areas north and west of Baghdad being addressed first, followed by other locations, though some will not require a wall or trench due to natural features, Maan said.

Territory held by the Islamic State jihadist group is located north and west of the capital, making those directions the priority.

After the completion of the first phase, which is expected to take six months, Maan said that 50 percent of checkpoints inside Baghdad will be removed.

The city is littered with checkpoints that often wave cars through or at most perform cursory searches, adding little to security while causing major traffic jams.

Baghdad is often hit by bombings and other attacks, but security in the capital has improved since IS launched a sweeping offensive in June 2014, likely because the jihadists have subsequently been occupied elsewhere.