At least 50 people have been killed and scores more wounded in a series of bombs in the Iraqi capital, Baghdad, medical and police officials said.

At least 38 people were killed in two car bombings in Shia-dominated areas of western Baghdad on Saturday night. A third blast caused by a suicide bomber killed another 12 people and injured 40 others.

Al Jazeera's Imran Khan, reporting from Baghdad, said the explosions happened within minutes of each other and that they may be linked to events in western Iraq, where the Iraqi army, supported by foreign air strikes, is battling the Islamic State of Iraq and the Levant group.

"What we normally see is when car bombs go off it is normally as a result of an action that's taking place in Anbar province. Usually against ISIL fighters," he said.

Anbar, just west of Baghdad, has been the scene of intense battles between Iraqi government forces and ISIL fighters, who have taken control of large sections of northern and western Iraq this year.

In other violence, four Iraqi soldiers died in a friendly fire incident in the town of Udaim, 90km northeast of Baghdad.

The soldiers, who had been wounded by ISIL fighters, were being taken to hospital when Shia volunteer fighters mistook them for ISIL members and fired a rocket-propelled grenade at their vehicle, police and medical officials said.

Saturday's violence came as ominous warnings were sounded that ISIL could be close to taking over the whole of western Anbar province.

US defence officials said Iraqi government forces were in a "tenuous" position in Anbar, where the few remaining government-controlled areas have come under repeated attack from ISIL.

Al Jazeera's Zeina Khodr, reporting from the main Kurdish city, Erbil, in northern Iraq, said local government officials were appealing for help.

"They believe that it is just a matter of days, up to 10 days, and ISIL can control the whole of Anbar," she said.

"Anbar is the biggest province in Iraq and it also borders Syria, which means that ISIL can open a supply line between its strongholds in Iraq as well as in Syria. It is also on the doorstep of Baghdad."

Parts of Anbar province fell to ISIL at the start of the year and much of the rest was seized by the group in a lightning sweep through Iraq's Sunni Arab heartland in June.