Islamic State militants have launched a surprise offensive on Iraq's northern oil-rich city of Kirkuk, killing a top Peshmerga commander and battling Kurdish fighters for control of a central police base.

The assault began at around midnight on Thursday when Islamic State (IS) fighters launched mortars and attacked four southwestern sectors of Kirkuk, according to police and military officials who spoke to AFP and Reuters. Reports started emerging on Friday morning when the group had penetrated an abandoned hotel used as a police station in the center of the city. Attacks in Baghdad and Samarra also took place on Friday.

Peshmerga Brigadier Sherko Shwani, also known Shirko Rauf or Shirko Fatih, was killed as the Kurdish forces fought to repel the Kirkuk offensive, along with five other soldiers.

Dozens of Peshmerga fighters were reportedly wounded in the clashes. Kurdish reports said that the IS forces had attacked their positions with suicide and car bombs.

There has been speculation recently that the Islamic State might assault the oil-rich Kurdish city — which has seen less frequent attacks than areas further south — in order to distract the Peshmerga from a potential attempt to liberate the city of Mosul from its control.

Local authorities immediately established a curfew in the aftermath of the attack. A Peshmerga officer said that one of the four districts, Mariam Bek, had been recaptured, while clashes were still ongoing in the other three.

A dozen IS fighters broke into the Kirkuk Palace Hotel, used by the local police as operational base, later in the morning. Peshmerga forces were reported to have cleared the building, but not before two suicide bombers detonated their devices in an attempt to keep the Kurdish fighters out.

Three Islamic State militants were reportedly killed. A video shows alleged Peshmerga fighters firing victory shots to celebrate the evacuation of the hotel.

In this video, Peshmerga forces appear to be firing victory shots from the top of the Palace Hotel after re-capturing the building.

While the attack on Kirkuk was taking place, two bombs killed at least 18 people in the Iraqi capital, Baghdad. The area hit, Bab al-Sharqi, is contained within the River Tigris and the Green Zone, home to governmental offices and foreign embassies.

Local police in Samarra — 77 miles (125km) north of Baghdad, where in February 2006 Sunni fighters destroyed a Shiite shrine, triggering a renewed phase of sectarian violence — reported that two suicide attacks killed at least three people at a checkpoint in the city's center. A skirmish between the police and IS fighters ensued on its outskirts.

More than 750 peshmergas have perished since the Islamic State's counteroffensive on northern Iraq started last summer. US-led air strikes have been deployed in defense of the Kurdish fighters, allowing the Peshmerga to regain much of the ground they had lost to IS in August. But commanders still complain that they are under-equipped, claiming IS's raids of arm depots in Mosul last summer has given them a military advantage.