By Isabel Coles, Saif Hameed and Ulf Laessing

ERBIL/BAGHDAD, Iraq (Reuters) - Kurdish and Shi'ite forces near Mosul have agreed to coordinate their operations in support of a U.S-backed offensive seeking to encircle and capture Islamic State's last major urban stronghold in Iraq, U.S. and Iraqi officials said on Thursday.

The agreement will restrict the movement of the jihadists in and out of Mosul and aid the attempts of the forces ranged against them to complete the encirclement of the city from the western side, according to the officials.

It came after Iraqi Kurdish and Shi'ite fighters linked up near the Islamic State-held town of Tal Afar, west of Mosul, on Wednesday in an advance that cut the militant group's supply route from the rest of the territory it holds in western Iraq and Syria.

Islamic State retaliated with a massive truck bomb in Hilla, hundreds of kilometers from the front lines, which are in Iraq's far north. The attack on Thursday killed about 100 people, most of them Iranian pilgrims returning from the Shi'ite holy city of Kerbala, according to police and medical sources.

The agreement between the Iraqi Kurds and Shi'ite groups was reached at meeting between commanders of Kurdish peshmerga forces deployed in Sinjar, west of Mosul, and Hadi al-Amiri, the leader of the Iranian-backed Badr Organisation.

Badr is the biggest component of a coalition of Shi'ite forces known as Popular Mobilisation who are assisting the U.S. backed offensive seeking Mosul's capture - regarded as a major step in dismantling Islamic State's self-styled "caliphate".

"The joining of these forces greatly reduces the freedom of movement of ISIL insurgents in and out of Mosul," said Air Force Col. John Dorrian, a Baghdad-based spokesman for the U.S.-led coalition, referring to Islamic State. "They have already lost the effective ability to move in large numbers, but now this has been made more difficult for them."

Mosul is already ringed to the north, south and east by Iraqi government forces and Kurdish peshmerga forces. Iraq's U.S.-trained Counter Terrorism Service breached Islamic State defenses in east Mosul at the end of October and is battling to expand its foothold in the city.

THOUSANDS FLEE

The offensive to take Mosul started on Oct. 17 with air and ground support from a U.S.-led coalition. It is turning into the most complex campaign in Iraq since the 2003 invasion that toppled Saddam Hussein.

The Iraqi military estimates there are 5,000 to 6,000 insurgents in Mosul facing a 100,000-strong coalition of Iraqi government units, Kurdish peshmerga and Shi'ite militias.

Islamic State leader Abu Bakr al-Baghdadi, believed to have withdrawn to a remote area near the Syrian border, has told his fighters there can be no retreat.

A prominent Popular Mobilisation leader, Abu Mahdi al-Mohandes, said on Wednesday his forces had reached a junction where Kurdish peshmerga forces were deployed in Sinjar, close to Syria.

But Islamic State remains in control of the 60 km (40 mile) road between Mosul and Tal Afar, which is hindering the forces battling the jihadists from completing the encirclement of Mosul from the west.

Mohandes said Popular Mobilisation units would next try to separate Mosul from Tal Afar, which lies on the route between Mosul and Raqqa, the jihadists' main city in Syria.

Thousands of civilians fled Tal Afar this week as Popular Mobilisation forces close in on the town, which is mostly populated by ethnic Turkmen.

The exodus is worrying humanitarian organizations as some of the civilians are heading into insurgent territory, where aid cannot be sent to them, provincial officials said on Wednesday.

Those fleeing Tal Afar are Sunni Muslims, who are in a majority in Nineveh province in and around Mosul but a minority in Shi'ite-majority Iraq. Tal Afar also had a Shi'ite community, which fled in 2014 when Islamic State, an ultra-hardline Sunni group, swept through the region.

Abadi tried to allay fears of ethnic and sectarian killings in Tal Afar, saying any force sent to recapture it would reflect the city's diversity.

MOSUL TUNNELS

Islamic State fighters in Mosul are dug in among more than a million civilians as a tactic to hamper air strikes. They are moving around the city through tunnels, driving suicide car bombs into advancing troops and hitting them with sniper and mortar fire.

"We are controlling large parts of the eastern side," the commander of the Counter Terrorism Service, Talib Shaghati, told reporters in Bartella, one of the first villages taken from Islamic State in the offensive. "One of the challenges we face ... is the presence of civilians."

Nearly 69,000 people are registered as displaced by the fighting, moving from villages and towns around the city to government-held areas, according to U.N. estimates.

The figure does not include the thousands of people rounded up in villages around Mosul and forced to accompany Islamic State fighters to cover their retreat toward the city as human shields. It also does not include the 3,000 families which have fled Tal Afar.

Earlier this month, the bodies of at least 20 people killed by Islamic State were hung up across Mosul- five crucified at a traffic junction - to warn residents against cooperating with the Iraqi military.

"Mosul's residents are part of the security forces. They are cooperating with us," said Counter Terrorism Service commander Shaghati. "They give us information."

(Writing by Maher Chmaytelli; Editing by Giles Elgood and Pravin Char)