By Alexander Winning and Christian Lowe

MOSCOW (Reuters) - President Bashar al-Assad was out of step with the views of his main ally, Russia, when he said he planned to fight on until he re-established control over all of Syria, Russia's envoy to the United Nations was quoted as saying on Thursday.

In the first public sign of cracks in the alliance between Moscow and Damascus, the envoy, Vitaly Churkin, said Russia had helped Assad turn the tide of the war so it was now incumbent on him to follow Russia's line and commit to peace talks.

Churkin said Russia was working toward a peaceful settlement for Syria, and that attempting to take back control over the whole country would be a futile exercise which would allow the conflict to drag on indefinitely.

Asked in an interview with Kommersant newspaper about Assad's comments that he would keep fighting until all rebels were defeated, Churkin said: "Russia has invested very seriously in this crisis, politically, diplomatically, and now also in the military sense.

"Therefore we of course would like that Bashar al Assad should take account of that."

"I heard President Assad's remarks on television... Of course they do not chime with the diplomatic efforts that Russia is undertaking.... The discussions are about a ceasefire, a cessation of hostilities in the foreseeable future. Work is underway on this."

Moscow and Damascus have been in lock-step since the end of September last year, when Russia launched air strikes on Syria which focused on attacking rebels opposed to Assad's rule.

The Russian strikes saved Assad's forces from imminent collapse and turned the tide of the fighting in his favor, exasperating the United States and its allies which have been working for years to defeat him.

Western diplomats expressed hope that Russia could use its influence over Assad to persuade him to start talks with armed opposition groups and eventually agree to step down.

Unofficial reports have emerged of Assad refusing to meet opposition figures proposed by Moscow as potential negotiating partners, but Churkin's remarks are the first public sign that Moscow is frustrated with Assad's reluctance to compromise.

Story continues

On Assad's comments about fighting on in Syria, Churkin said in the interview: "In this case I think that we ought to be guided not by what he (Assad) says, with all my respect to the remarks of such a high-ranking person, but by what he does in the end.

"If the Syrian authorities... follow Russia's lead in the resolution of this crisis, then they have a chance to get out of it with their dignity intact."

"But if in some way they are knocked off that path -- and this again is my personal opinion -- then a very difficult situation could arise. Including for the Syrians themselves. Because whatever the capabilities of the Syrian army, it was the effective operations of Russian air forces that allowed them to push their opponents back from Damascus."

"If they take the position that they don't need any ceasefire, and they need to fight on to the end and to victory, then this conflict is going to carry on for a very long time. And it's frightening to imagine that," Churkin said.

(Reporting by Alexander Winning; Editing by Christian Lowe)