KABUL/SINGAPORE (AFP) - US Defence Secretary Robert Gates said it was "premature" to change strategy in the Afghan war, during a surprise farewell trip to the war-torn country Saturday. Gates urged President Hamid Karzai's government to "step up" in order to ensure that the process of handing control of security from foreign to Afghan troops, due to start within weeks, was a success. Gates's comments came at a press conference with Karzai hours after touching down in Kabul for a visit focused on saying goodbye to some of the roughly 90,000 US troops in Afghanistan after four-and-a-half years at the Pentagon. The trip also comes at a crucial moment for US policy on the increasingly unpopular war in Afghanistan. The United States is expected to start troop withdrawals in July but the White House is still debating the scale and pace of the drawdown. Speaking alongside Karzai in the gardens of the top-security presidential palace, Gates said he was in favour of sticking with the current war strategy before assessing military progress at the end of the year. He also raised the possibility of peace talks with the Taliban by that stage. "I believe that if we can hold on to the territory that has been recaptured from the Taliban... we will be in a position toward the end of this year to perhaps have a successful opening with respect to reconciliation, or at least be in a position where we can say we've turned a corner," Gates said. "I think making any change prior to that time would be premature." He called on the Afghan government to do more to make the transition process, due to start around July with Afghan security forces taking control from foreign troops in seven areas, a success. "For this upcoming transition to be successful, the Afghan government and security forces must be willing to step up and take more and more responsibility for governing and defending their own territory," he said. While offering reassurances that the international community would not "rush to the exits" after the planned end of foreign combat operations in 2014, Gates stressed their commitment to Afghanistan was "not infinite." Acknowledging "weariness in both of our countries over the duration and costs of the conflict," Gates also addressed Karzai's major domestic preoccupation - civilian casualties in international military operations. Karzai this week issued some of his strongest comments yet on the long-running issue, saying foreign attacks on ordinary Afghan homes were "banned" and NATO risked becoming an "occupying force" if they continued. That came after the deaths of what the Afghan president said was 14 civilians including 11 children in an air strike in the troubled southern Helmand province. Gates said that civilian casualties were "losses we mourn and profoundly regret." Karzai said the pair had held "detailed" talks on night raids and air strikes. "Regarding the aerial bombardments on the homes of people, we clearly presented the demand and wishes of the people of Afghanistan, which is a clear ban on such bombardments," Karzai said. As Gates arrived in Afghanistan, the deaths of four international troops were announced by the military, without disclosing their nationalities. They bring to at least 224 the foreign military death toll so far this year. Troop commanders say this year's fighting season will be a key test of gains made by a US-led troop surge, but more foreign troops have already been killed in April and May than in the same months of any previous year. Gates said the amount of money the United States spends on the war - roughly $120b a year - should not shape the decision on the speed of the withdrawals. Some US officials and lawmakers say this should be a key factor in the face of a fragile domestic economy. "I think that once you've committed, that success of the mission should override everything else. Because the most costly thing of all would be to fail," Gates said. Earlier in Singapore, Robert Gates warned Saturday that clashes may erupt in the South China Sea unless nations with conflicting territorial claims adopt a mechanism to settle disputes peacefully. "There are increasing concerns. I think we should not lose any time in trying to strengthen these mechanisms that Ive been talking about for dealing with competing claims in the South China Sea," he said. "I fear that without rules of the road, without agreed approaches to deal with these problems, that there will be clashes. I think that serves nobodys interests," Gates told a security conference in Singapore, before flying to Kabul. Gates called on the countries involved to build on a 2002 agreement between the Association of Southeast Asian Nations and China setting a "code of conduct" aimed at resolving disputes peacefully.