The militants brought the two men into a square in the northern Syrian city of Aleppo, then announced their punishment for failing to attend Friday prayers: 25 lashes delivered by a hose-wielding militant that left their backs covered in welts and dark bruises.

The whipping, captured on video as dozens of men and boys watched, was carried out two years ago by the ultraconservative Ahrar al-Sham, or Free Men of Syria, an Islamic militant group with links to al-Qaida.

But since then, the group has been shifting tactics, seeking to portray itself as a moderate force fighting both President Bashar Assad's troops and the extremists of the Islamic State group. Backed by U.S.-ally Turkey, Ahrar al-Sham has sought to recast itself as a player acceptable to Washington and the West, while distancing itself from al-Qaida's affiliate in Syria and its jihadi ideology.

To that end, Labib Al Nahhas, the group's self-styled foreign affairs director, has written opinion pieces in the Washington Post and Britain's Daily Telegraph that present Ahrar al-Sham as a moderate alternative and potential partner for Western governments.

The group has also vowed to defeat what it calls the Russian "occupation" of Syria after Moscow began launching airstrikes on insurgents last week. In a post on Twitter, its leader, Muhannad al-Masri, warned: "The Soviet Union entered Afghanistan, where it faced its end, and its boys will face the same end in the land of the Levant, God willing."

Unlike the Islamic State group and al-Qaida's branch in Syria, the Nusra Front, Ahrar al-Sham is not on the U.S. list of terrorist organizations. However, Washington remains suspicious because of its links to al-Qaida, especially since one of the group's founders was known to be close to al-Qaida leader Ayman al-Zawahri.

A powerful, well-organized force with thousands of fighters spread across Syria and a large presence in the key provinces of Idlib and Aleppo, analysts say Ahrar al-Sham is positioning itself to play a major role in the U.S.-Turkish plan to set up an IS-free zone along the Syrian border with Turkey.

"Turkey has been really working very hard for more than a year trying to convince the Americans and the U.S.-led coalition that Ahrar al-Sham is not al-Qaida, that Ahrar al-Sham could be weaned off Nusra Front," said Fawaz A. Gerges, director of the Middle East Center at the London School of Economics. "The Americans are very suspicious."

Turkish Prime Minister Ahmet Davutoglu has said that Ankara has no plans to send ground troops into Syria, but instead wants to see Syria's moderate opposition forces take over areas currently controlled by IS near the Turkish border.

Considered the best-armed and organized militant group in Syria after IS and the Nusra Front, with tanks, armored vehicles and multiple rocket launchers, Ahrar al-Sham's push to rebrand itself comes at a time when the West and the U.S. desperately need allies inside Syria.

A U.S. counterterrorism official told The Associated Press that Ahrar al-Sham clearly wants "a seat at the table" in post-conflict Syria.

But Washington remains skeptical that the group has truly broken away from the Islamic extremist ideology of its founders, said the official, who spoke on condition of anonymity in order to discuss sensitive intelligence matters.

In recent months, the group has made major military advances, capturing large swaths of the northwestern province of Idlib, including the provincial capital of the same name. Last month, the militants seized the last army air base in Idlib, making it the second province in the country to fall fully out of government hands, after Raqqa, which is controlled by IS. Ahrar al-Sham's advances have also brought it close to Assad's traditional stronghold on the Mediterranean coast.

The group's effort to transform itself has brought internal tensions. These include dissension over the elevation of local Syrian-born fighters into its leadership, sidelining foreign jihadis. Earlier this year the group changed its slogan to "revolution of the people" in an attempt to bill itself as a homegrown movement, as opposed to the global pan-Islamic rhetoric espoused by al-Qaida and the Islamic State group.

"We raised arms because we had no other choice — either we unconditionally surrender or we fight for the freedom of our people from Assad, Iran and ISIL. We choose the latter," Al Nahhas wrote in a recent opinion piece in Britain's Daily Telegraph, using an alternative acronym for the Islamic State group.

Battles pitting Ahrar al-Sham and its allies against IS fighters in northern Syria have become a regular occurrence. According to activists, the group has also recently distanced itself from several top figures who oppose to Turkey's intervention in northern Syria, including its former religious chief, Abu Shuaib al-Masri.

"I think Ahrar al-Sham has not resolved the ideological tension, the split personality," Gerges said. "The pendulum within Ahrar al-Sham is slowly and gradually tilting" away from the pan-Islamic jihadi ideology of its founders and toward the group's newly claimed identity as a home-grown, nationalist force.

Ahrar al-Sham's apparent courting of the West carries with it significant risks. Over the past year, the Nusra Front has crushed three moderate rebel groups in northern Syria for their links with the U.S. And in a recent post on Arab websites, a prominent Nusra Front figure, Abu Firas al-Souri, was quoted as accusing Ahrar al-Sham of "marketing for the projects of infidels in Syria."

The U.S. counterterrorism official said the group's strategy runs the risk of total isolation. By signaling a willingness to break with the Nusra Front, he said, Ahrar al-Sham could find itself alienated from al-Qaida and other extremist groups but still not trusted or supported by the West.

Months after the uprising against Assad's government began in March 2011, Ahrar al-Sham was founded by several Islamists, including Mohammed Baheya, better known as Abu Khaled al-Souri, who had links to al-Qaida leader al-Zawahri. Baheya reportedly fought against U.S. troops in Afghanistan and Iraq.

Baheya was killed last year while trying to mediate between the Islamic State group and the Nusra Front in a suicide bombing blamed on IS. Ahrar al-Sham survived its most serious blow in September 2014 when a mysterious explosion in Idlib province killed some of its top figures, including its leader, Hassane Abboud.

Ahmad al-Ahmad, a Syrian journalist in Hama province who heads an opposition media outlet, the Syrian Press Center, said Ahrar al-Sham's main source of income comes from the Bab al-Hawa border crossing with Turkey, where the group charges trucks between $15 and $100 per ton depending on their cargo.

In late September, a U.N.-backed truce deal was reached for two key Syrian battleground areas that will see the transfer of thousands of Shiite and Sunni civilians and fighters from one area to another.

Significantly, it was Ahrar al-Sham — the main faction fighting in those areas — that negotiated the deal with envoys from Assad's top ally, Iran, which is bitterly hated by the rebels and considered an "infidel" power by the radicals among them. Ahrar al-Sham's involvement showed its ability to play a political role, beyond just fighting on the ground.

Late last month, the group chose al-Masri, a Hama native, as its new leader, and observers and activists say he appears to be leading Ahrar al-Sham away from al-Qaida and its influence.

"It is likely that al-Masri will also continue the general movement away from collaboration with (the Nusra Front) ... which has been a key source of concern among Western governments," said The Soufan Group, a security consulting firm.

The divide between the two Islamic groups appears to be widening, it said, "putting significant pressure on extremist wings within Ahrar al-Sham which are sympathetic to al-Qaida."

___

Associated Press intelligence writer Ken Dilanian in Washington contributed to this report

___

Follow Bassem Mroue on Twitter at http://twitter.com/bmroue