Dozens of Syrian soldiers who had crossed into Iraq for refuge were ambushed Monday with bombs, gunfire and rocket-propelled grenades in an attack that killed 48 of them and heightened concerns that the country could be drawn into Syria's civil war.

The fact that the soldiers were on Iraqi soil at all raises questions about Baghdad's apparent willingness to quietly aid the embattled regime of Syrian President Bashar Assad.

The well-co-ordinated attack, which Iraqi officials blamed on al-Qaeda's Iraq arm, also suggests possible co-ordination between the militant group and its ideological allies in Syria — some who rank among the Syrian opposition’s most potent fighters.

Iraqi officials said the Syrians had sought refuge through the Rabiya border crossing in northern Iraq during recent clashes with anti-Assad fighters and were being escorted back home through a different crossing farther south when the ambush occurred. Their convoy was struck near Akashat, not far from the Syrian border.

Ali al-Moussawi, a spokesman for Iraq's prime minister, provided the death toll and said nine Iraqi soldiers were also killed.

He said the soldiers had been allowed into Iraq only on humanitarian grounds and insisted that Baghdad was not picking sides in the Syrian conflict.

"We do not want more soldiers to cross our borders and we do not want to be part of the problem," al-Moussawi said. "We do not support any group against the other in Syria."

The Iraqi Defence Ministry said 10 additional Syrians were wounded in the assault. In a statement, it warned all parties in the Syrian war against bringing the fight into Iraq, saying its response will be "firm and tough."

Iraqi officials who provided details of the attack described a carefully orchestrated assault on the Syrians' convoy, with a senior military intelligence official saying the attackers appeared to have been tipped off ahead of time.

He and another Iraqi official, speaking on condition of anonymity because they weren't authorized to release the information, said it was unlikely that Syrian rebels had managed to cross into Iraq to carry out the attack.

"This attack bears the hallmarks of the al-Qaeda terrorist organization," said Jassim al-Halbousi, provincial council member in Anbar, the restive western region where the attack happened.

"The borders should be secured at the highest level of alert."

Syrian conflict fueled by sectarian violence

hi-world-syria-iraq-attack-

Tension is high in Syria's border areas after 48 Syrian troops were killed in Iraq, just across the country's eastern border. Here, Kurdish fighters stand guard at a check point near the northeastern city of Qamishli, Syria. (Manu Brabo/Associated Press)

Iraqi Prime Minister Nouri al-Maliki told The Associated Press last week that he feared a victory for the anti-Assad side Syria’s civil war would create a new extremist haven and destabilize the wider Middle East, sparking sectarian wars in his own country and in Lebanon.

His comments reflect fears by many Shiite Muslims that Sunni Muslims would come to dominate Syria should Assad be toppled. Assad's regime is backed by Shiite powerhouse Iran, which has been building ties with the Shiite-led government in Baghdad in recent years.

The war in Syria has sharp sectarian overtones, with predominantly Sunni fighters taking on regime forces who are mostly Alawites, an offshoot of Shiite Islam. Syrian opposition groups have increasingly embraced radical Islamic ideologies, and some of their greatest battlefield successes have been carried out by Jabhat al-Nusra, a group that the U.S. has designated as a terrorist organization and that it claims has links to al-Qaeda.

Iraq's government has faced more than two months of protests from Sunni Muslims angry over perceived discrimination. Anbar province has been the epicenter for the rallies.

Toby Dodge, a Middle East expert at the London School of Economics, said the fact that Syrian soldiers had been welcomed into Iraq at all is worrying.

"If this goes on, al-Maliki's government is aligning itself with Iran and the Assad regime against the rest of the Middle East and the will of the Syrian people," he said. "That is a huge gamble."

Anti-Assad forces close to controlling northern city

In Syria, rebels pushed government troops from most of the northern city of Raqqa, on the Euphrates River, setting off celebrations in a central square.

If rebels succeed in taking Raqqa, which has a population of about 500,000, it would be the first time an entire city had fallen into the hands of anti-Assad fighters.

Rebels already hold several neighbourhoods in the cities of Aleppo, Homs and Deir el-Zour, as well as suburbs of the capital, Damascus. They also control large areas in the countryside, particularly in the north.

Their advances are a significant blow to Assad, although during the past week his forces have regained control of several villages and towns along a key highway near Aleppo International Airport.

The Britain-based Syrian Observatory for Human Rights said rebels are now in control of "large parts" of Raqqa, which flows through Syria into Iraq. A top police officer was killed and intelligence officers were detained, the group said.

Activists declared Raqqa "liberated" on opposition social media websites Monday. A photo posted on several pro-rebel Facebook pages showed people tearing down a huge poster of Assad and hitting it with their shoes. The activists said the picture was taken inside the feared air force intelligence headquarters in the city.

The Observatory said the leader of Jabhat al-Nusra in Raqqa was killed in the fighting.

Amateur video posted online showed a bronze statue of former President Hafez Assad, the current president's father and predecessor, being torn to the ground by a rope tied around the statue's neck. The video appeared consistent with AP reporting.

Amir, an activist in Raqqa, said via Skype that the mood was euphoric in the city when residents and rebels toppled the statue in the main square, but "then the shelling began and everyone fled."