Civilians inspect the aftermath of a car bomb attack in the Husseiniyah area of northeastern Baghdad, Iraq, on Thursday.

BAGHDAD — Clashes spread to a key northern city and gunmen took over a town elsewhere in Iraq on Thursday, raising the death toll from three days of violence to more than 150 people as a wave of Sunni unrest intensified.

The turmoil is aggravating an already sour political situation between the Shiite-led government and Sunnis, who accuse Prime Minister Nouri al-Maliki’s government of neglect and trying to disenfranchise their Muslim sect.

Al-Maliki appeared on national television appealing for calm amid fears the country is facing a return to full-scale sectarian fighting more than a year after U.S. troops withdrew.

The spreading violence came as Iraqi electoral officials announced preliminary results in local elections held Saturday — Iraq’s first since U.S. troops left in December 2011.

With 87 percent of the ballots counted, al-Maliki’s State of Law bloc was on track to win the most votes in eight of the 12 provinces participating in the vote, including Baghdad and the southern oil hub of Basra.

Anti-American cleric Muqtada al-Sadr’s bloc was ahead in the southern Shiite province of Maysan, while a provincial level coalition was leading in the Shiite province of Najaf. Local coalitions also were ahead in the largely Sunni province of Salahuddin and the mixed province of Diyala.

The government last month delayed voting in two predominately Sunni provinces where anti-government protests have raged for months, citing security concerns.

The final results will offer a key measure of support for the country’s political blocs and could boost the victors’ chances heading into next year’s parliamentary elections.

The election announcement was overshadowed, however, by the rising unrest.

Gunmen and police clashed for hours in several districts of the former Sunni insurgent stronghold of Mosul before security forces brought the situation under control Thursday afternoon.

Police said 31 militants and 10 police were killed in the fighting in Mosul, which has been one of the hardest areas to tame since bloodshed erupted after the U.S.-led invasion that ousted Saddam Hussein. Many residents remained holed up in their homes out of fear, although the city was largely quiet by evening.

Clashes also erupted late Thursday between gunmen and security forces in the former al-Qaida stronghold of Baqouba, prompting authorities to impose a curfew there and in the surrounding province, according to police.

The latest unrest began on Tuesday when fighting broke out in the northern town of Hawija during a security crackdown on a protest encampment. Three members of the Iraqi security force and at least 20 other people were killed. The government said gunmen fired on the security forces as they entered the camp to make arrests related to an earlier incident.

Iraqi Sunnis say they face discrimination, particularly in the application of a tough anti-terrorism law that they believe unfairly targets their sect, which formed the backbone of the insurgency but also was key to the downturn in violence after tribal leaders turned against al-Qaida in Iraq.

The government frequently carries out arrests in Sunni areas on charges of al-Qaida or Baathist ties. Protests escalated in December after the arrest of bodyguards assigned to Finance Minister Rafia al-Issawi, a Sunni, in late December.

The Defense Ministry said in a statement that gunmen had taken control of the Suleiman Beg police station and other governmental buildings, and were deployed in the streets of the town, about 150 kilometers (90 miles) north of Baghdad. The ministry did not provide information on casualties.

On Wednesday, police and hospital officials reported fierce clashes in the town that resulted in the deaths of four soldiers and 12 others, including some gunmen.

The mayor of the city of Tuz Khormato, to which Suleiman Beg is administratively annexed, said security forces had laid siege to the small town and sporadic clashes were continuing. The official, Shalal Abdool, said there were additional casualties among gunmen on Thursday, but he couldn’t provide numbers.

In his first public comments since the Hawija killings, al-Maliki urged Iraqis to unite for the sake of the country and stand up against extremists.

“We all have to shoulder responsibility after what happened in Hawija and what’s going on today in Suleiman Beg and other areas,” he said. “If (sectarian) conflict erupts, there will be no winner or loser. All will lose, whether in southern or northern or western or eastern Iraq.”

Northeast of Baghdad, the Iraqi army has surrounded the town of Qara Tappah, where deadly clashes also were reported on Wednesday. The army and some tribal leaders in the town are in contact to try to ease the tensions, and the situation is calm for now, according to local police. Qara Tappah is about 120 kilometers (75 miles) northeast of the capital.

Gunmen also opened fire on a police checkpoint near Fallujah, west of Baghdad, killing two policemen and wounding two others, according to police.

A Sunni politician who recently announced his resignation from the Cabinet urged al-Maliki, a Shiite, to step down to calm the tensions.

“Iraq is in a dire situation now and I believe that there must be serious solutions,” Abdul-Karim al-Samarraie told The Associated Press on Thursday in a phone interview. “One of the solutions is the resignation of the prime minister and for him to leave the government to another who can run it temporarily. Otherwise, the options for Iraq are only dangerous ones.”

Al-Samarraie is Iraq’s minister of science and technology. He and Minister of Education Mohammed Tamim submitted their resignations this week in the wake of the killings in Hawija. Al-Samarraie said that Industry Minister Ahmed al-Karbouli also submitted his resignation.

Al-Karbouli could not be reached for comment, but an official in his office confirmed the move.

In other violence reported by police and hospital officials Thursday, attackers detonated explosives on a key oil pipeline linking Kirkuk to the Turkish port of Ceyhan near the town of Shurqat, disrupting crude oil exports.

A roadside bomb also struck two army vehicles patrolling south of Baghdad, killing two soldiers and wounding six others. And a car bomb went off near a bus stop in Najaf, killing four people and wounding 12.

The officials spoke on condition of anonymity because they weren’t authorized to release the information.