Smoke billows in the background as an Iraqi paramilitary fighter flashes the victory sign after pro-government forces regained control of the village of Albu Ajil, near the city of Tikrit, from Islamic State fighters on March 9, 2015. (Ahmad Al-Rubaye/AFP/Getty Images)

Of all the allies that Iraqi forces might work with to defeat the Islamic State, the Jubbour tribe would seem to be among the most ideal.

Its members are powerful, pro-government and eager to take on the jihadists. But for Shiite leaders in Baghdad, there was one problem: the Jubbour tribesmen are Sunnis — and from an area where local tribes have collaborated with the Islamic State.

Now, after extensive negotiations, both sides are fighting together in the battle to reclaim Tikrit, a city 110 miles northwest of Baghdad, from an entrenched force of Islamic State fighters. They have made significant progress: On Tuesday, the pro-government forces captured the key district of Alam outside Tikrit. But their uneasy alliance shows the difficulties of bridging Iraq’s deep sectarian division.

Bringing Sunnis and Shiites together to battle the Islamic State is a linchpin of U.S. strategy in Iraq. The cooperation in Tikrit could be a model for future battles. Still, such alliances are rare, and revenge attacks by Shiite militias on local residents could quickly destroy the goodwill.

On Tuesday, a video posted to YouTube appeared to show members of the Shiite militia Assaib ahl al-Haq burning the homes of Sunni residents of Abu Ajeel, another village near Tikrit that was recently in the hands of the Islamic State. After military operations in Diyala province recently, Shiite gunmen killed dozens of Sunni residents, Sunni officials said.

“The Shiite militias have a track record of sectarian atrocities,” said Hassan Hassan, co-author of “ISIS: Inside the Army of Terror.” The Islamic State, an al-Qaeda offshoot, is also known as ISIS or ISIL.

“This is being portrayed as a Sunni-Shia national effort,” Hassan said. “And it’s far from it. The fears are real.”

Sectarian tensions rose in Iraq in the aftermath of the 2003 U.S.-led invasion that toppled strongman Saddam Hussein. He had long favored his fellow minority Sunnis over the country’s Shiite majority.

When the Shiites came to power, then-Prime Minister Nouri al-Maliki implemented sectarian policies that fed a wave of discontent among Sunni communities already feeling disenfranchised. The Islamic State, which grew out of a group called al-Qaeda in Iraq, capitalized on the unrest to eventually seize wide swaths of territory. In June, the militants captured Tikrit, a midsize city that was Hussein’s home town.

Then, at a nearby military base, Islamic State fighters kidnapped and massacred as many as 1,700 Shiite soldiers attempting to flee the militant offensive. Some of the local Sunni tribes — particularly from the village of Abu Ajeel — were said to have aided the jihadists. Shiite militias recruited to fight alongside Iraqi forces have portrayed their current offensive as revenge for that bloodbath.

The Jubbour tribe, whose stronghold is the nearby town of Alam, initially resisted the militants’ summer onslaught. The tribe’s chief, Sheik Khames al-Jebbara, helped Shiite survivors escape by providing fake identification cards that labeled the soldiers as Sunnis. Then the residents of Alam took up arms against the militants, battling for two weeks until they were forced to acquiesce. The Islamic State later carried out reprisal attacks against Jubbour members, kidnapping and killing dozens.

Still, Iraqi officials and Shiite commanders were hesitant to bring the tribesmen on board for the recent fight. Shiite leaders were worried that Sunni militants would try to infiltrate the militias, according to officials involved in the negotiations between the two sides.

Shiite fighters and Iraqi security forces ride in an armored vehicle in the town of Alam on March 9, 2015. (Thaier Al-Sudani/Reuters)

The Sunnis wanted to make sure the government would support them in any long-term fight against the jihadists. After U.S. forces armed Sunni tribes to fight al-Qaeda-led insurgents in Iraq in 2006-2007, Maliki disbanded the Sunni forces. Many of the fighters felt betrayed and either joined or were targeted by anti-government insurgents.

The militia leaders “wanted to make sure every [Sunni] volunteer had a clean sheet,” said Omar al-Jebbara, a Jubbour tribesman from Alam who is fighting in the Tikrit operation. “And we wanted to make sure they could guarantee our future so we don’t become easy prey” for the Islamic State.

Both sides say the Shiite commanders agreed to work with the tribesmen from Alam after cooperating with a branch of the Jubbour tribe in Duluiyah. Together they ousted militants from that town north of Baghdad in December.

In the past two months, more than 500 Jubbour fighters trained with the militias and were supplied with light weapons. On Tuesday, pro-government forces recaptured Alam.

“We know the area. We know every path,” said Omar al-Jebbara, the fighter. “God willing, we will hold our ground.”

But the Jubbour tribesmen, while lauded as models of Iraqi unity, played only a nominal role in the battle. They acted as spotters and guides while thousands of militiamen charged into the area under Shiite banners.

Analysts say pro-government Sunnis are not necessarily representative of the larger Sunni population, which fears the rise of the Shiite militias.

There are Sunnis working with the Iraqi government and fighting with the militias, “but what role they have and how much they represent Sunni demands and Sunni grievances is a different story,” Hassan said.

On Monday, Iraq’s mufti, or chief Sunni spiritual leader, blasted the Tikrit offensive.

“It’s a sectarian movement, and they want to remove the Sunnis [from these areas], but they will never do it,” the mufti, Rafa al-Rifae, said of the Shiite militias, speaking on a local television station.

“I’m saying this so that those Sunni people who are cooperating with them will wake up,” he said. “Because right now, they are helping them [the militias] fight their own people.”

Mustafa Salim contributed to this report.