By Michael Georgy

BASHIQA, Iraq (Reuters) - Days after helping to capture the Iraqi town of Bashiqa northeast of Mosul, Syrian Kurdish fighters walk proudly past the corpses of Islamic State combatants still lying in the ruins.

As they inspect the devastated streets where militants hid in ditches under metal sheets, members of the 3,300-strong Rojava Brigade exude confidence.

Fighting alongside Iraqi troops, Shi'ite militias and Iraqi Kurdish peshmerga fighters, they believe they can win the battle for Mosul, the jihadists' last big city stronghold in Iraq.

They are also confident of defeating Islamic State in the civil war back home in Syria, where they hope to return to protect their fellow Kurds.

But, in a situation that illustrates the complexities of the fight against the world's most dangerous militant group, rivalries between Kurdish groups are being played out across borders and preventing the Rojava Brigade fighting in Syria.

"We want to protect our land and our people. We can defeat the jihadists at home," Brigadier General Mohamed Rashed, the leader of the Rojava Brigade, told Reuters in Bashiqa.

But, speaking regretfully of the situation in Syria, he said: "We made several attempts to go back."

Like about 20 percent of the men under his command, Rashed once served as an officer in the Syrian army. After an uprising broke out, he fled to Iraq, leaving behind his parents and dreams of creating an independent Kurdish state.

Others also left for Iraq with the help of smugglers, then began military training with the Rojava Brigade in Iraq.

For the last two years the brigade has received training and funding from the Zeravani, a police force controlled by the Iraqi Kurdish region's interior ministry.

During that time it has joined Iraqi Kurdish forces in just about every battle against the jihadists, including the Mosul offensive, confronting highly skilled snipers, improvised explosive devices (IEDs) and suicide bombers.

KURDISH RIVALRY

Returning to Syria seems highly unlikely anytime soon.

The main obstacle, Rashed says, is the Kurdish YPG militia, which is close to the Kurdistan Workers’ Party (PKK), a Marxist group that has fought a three-decade insurgency with Turkey for more autonomy.

The YPG has used the Syrian civil war to carve out an autonomous region across wide areas of northern Syria, which is known as Rojava in Kurdish. Ties between the main Syrian Kurdish groups and the Iraqi Kurdish authorities are however tense.

The head of the Kurdish-led administration in northern Syria accused the Iraqi Kurdish authorities earlier this year of imposing a siege on Rojava by closing their border, saying the Iraqi Kurds were acting in collusion with Turkey against them.

The United States regards the YPG as an ally in its fight against Islamic State, but Turkey considers it as a terrorist organization because of it has links with the PKK.

YPG spokesman Redur Xelil said he had no knowledge of the Rojava Brigade but that military groups formed outside the Syrian Kurdish area were in general not allowed to enter the territory.

"It is not permitted for any other military force formed outside Rojava or Syria to enter Rojava without the permission of the YPG and the (Kurdish) self-administration, because then there will be anarchy and this is what we absolutely cannot accept, particularly if this group does not recognize the legitimacy of the YPG and the self-administration," he said.

Both Syrian and Iraqi Kurds have been repressed by Arab governments in their own countries. Divisions among Kurds make the long-held Kurdish dream of an independent state across Syria, Iraq, Iran and Turkey even more remote.

Since 2014, when Islamic State swept through northern Iraq, 41 members of the Rojava Brigade have been killed and 200 have been wounded. Among these was a senior officer killed by an Islamic State sniper last week.

The Rojava Brigade has been helping clear jihadists from Bashiqa and other towns and villages.

Graffiti on the pockmarked walls in some parts of Bashiqa declare Islamic State leader Abu Bakr al-Baghdadi as the leader of the world's Muslims, harking back to the group's tight grip on the town until last week.

In one street, the corpse of an Islamic State fighter lays with a rusty metal rod attached to his lower leg, an apparent attempt to support a broken bone before he died.

A dirt tunnel inside one house leads to a spotless room once occupied by an Islamic State emir, or leader. It has wooden walls and an air conditioning unit.

Faisal Ayu, 40, arrived in Iraq in 2004. After he joined the Rojava Brigade and fought Islamic State, he was wounded by a suicide bomber in a car.

That did not break his resolve, and now he is eager to fight the militants back home in northern Syria. He rejects the idea of fighting YPG, saying Kurds fighting Kurds would cross a red line drawn by Kurdish President Masoud Barzani, in his capacity as commander-in-chief.

"We will wait," he said.

For now, they can only dream. “Step by step we will create Kurdistan,” said Rojava fighter Safwan Hassan, 24.

(Created by Michael Georgy, editing by Timothy Heritage and Pravin Char)