New York - Iran's President Hassan Rouhani on Sunday warned that the Syrian government must be allowed to remain in power to prevent ISIS from taking over the country.Rouhani, in New York to attend the United Nations General Assembly meeting, argued that the priority must be combating ISIS extremists in Syria, and that "political reforms" could follow."If we are to succeed in fighting terrorism, the government in Damascus cannot be weakened. It must be able to carry on the fight," Rouhani told a gathering of academics and journalists in New York."If the Syrian government is taken out of the equation, the terrorists will enter Damascus" and "the whole country will become controlled territory, a safe haven for terrorists," he said.The Iranian leader did not specifically address President Bashar Assad's fate, even though he made clear that regime change must take place after the stepped-up campaign to defeat ISIS jihadists.Rouhani's remarks came amid intense diplomacy over the way forward to end the four-year war in Syria that has left more than 240 000 dead and sent thousands of refugees fleeing to Europe.Russia strengthened its hand in shaping Syria's post-war future when it sent troops and fighter planes to Syria to help in the battle to defeat Islamic State which now controls large swaths of territory.Rouhani said Iran and Russia had a "almost a compatible mindset" on Syria because Moscow has "the same goal of fighting and defeating terrorism."Air campaign will failAfter meeting with French President Francois Hollande, Rouhani said there had been a shift in the West which was "up to a certain level" dropping its insistence that Assad must go."That opinion no longer has many fans in the West," he said.Rouhani also argued that the fight against the jihadists cannot be won with an air campaign after President Vladimir Putin said he was ruling out a ground offensive for the time being."Terror groups cannot be defeated by helicopter gunships, or missiles or aerial bombardment. This is simply not possible," he said.Tehran has been providing financial and military support to the Damascus regime as well as military advisers on the ground in Syria.Rouhani is expected to address the crisis in Syria in his speech to the UN General Assembly on Monday, after President Barack Obama and Russian leader Vladimir Putin take the podium.The Iranian mission to the United Nations said late Sunday that Rouhani will cut short his visit to New York and return to Tehran after his address.The president is returning to Tehran to deal with the aftermath of the deadly stampede at the hajj in Saudi Arabia that left at least 136 Iranians dead, the mission said.