Attacks in and around Baghdad killed at least 20 civilians on Tuesday, as Iraqi security forces repelled an attack by the Islamic State group on the country's largest oil refinery, officials said.

Seven people were killed when a car bomb exploded in a commercial area in the town of Mahmoudiyah, about 20 miles south of Baghdad, a police officer said. The car was parked in a mainly Shiite section of the town near a bakery and went off as people were standing in line to buy bread.

Another 13 civilians were wounded in the attack, the officer said.

Another car bomb exploded in a parking lot outside Baghdad's Yarmouk hospital, killing four civilians and wounding 10, police said. Three more civilians were killed and eight wounded when a bomb ripped through an outdoor market in Baghdad's northern Sabi al-Bor area, police added.

Later on Tuesday afternoon, two car bombs went off simultaneously in Baghdad's southeastern outskirts, in al-Wihda area, killing six civilians and wounding 13, another police officer said. One of the cars was parked in a commercial area while the second was in a nearby parking lot.

Four medical officials confirmed the casualty figures. All officials spoke on condition of anonymity because they were not authorized to release information.

The bombings came a day after attacks in and around Baghdad killed at least 15 civilians. The Islamic State group and other Sunni extremists carry out near-daily attacks targeting Iraq's security forces and the country's Shiite majority.

Also Tuesday, the deputy governor of the northern Salahuddin province said ISIS militants had used suicide armored car bombs to try to break into the Beiji refinery over the past two days. Ammar Hikmat said security forces repelled the attacks and remain in control of the facility. He said more than 20 militants were killed during the clashes and that several security forces were killed or wounded, without elaborating.

"We call upon the central government to send reinforcements immediately. The soldiers defending the refinery are exhausted and they are in need of any kind of help in order to withstand the attacks," Hikmat said.

Oil Minister Adel Abdul-Mahdi said Monday that Iraqi forces, backed by U.S.-led coalition airstrikes, repelled an ISIS attack over the weekend on Beiji.