Defense Secretary Robert M. Gates arrived in Kabul on Saturday with a message that Afghans must assume more responsibility for their security because the international commitment to Afghanistan is “not infinite, in either time or resources.”

Gates, on his last of 12 trips to Afghanistan in his four-year tenure as secretary of defense, stressed that the U.S. commitment to supporting Afghanistan’s government and training its security forces will be robust, but added that for the 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.”

Gates spoke at a news conference on the tree-shaded grounds of the presidential palace, alongside President Hamid Karzai, who has been increasingly critical of U.S. military operations, particularly airstrikes on Afghan homes and nighttime raids targeting Taliban insurgents.

Karzai, for his part, said he had told Gates in a meeting earlier Saturday about the Afghan government’s long-standing concern about civilian casualties and his desire for an end to coalition strikes. “The bombardment of civilian homes is the issue Afghans definitely want to end,” Karzai said at the news conference. “We cannot take this anymore.”

Karzai said NATO forces should adjust their strategy to focus more on negotiations with the Taliban; targeting insurgent sanctuaries, such as those in Pakistan; and eliminating civilian casualties. With those changes, he said, “we will fully be behind our partners.”

On Tuesday, after an airstrike in Helmand province that killed at least nine civilians, Karzai issued an ultimatum to coalition forces to stop bombarding Afghan homes. Otherwise, he said, Afghanistan would be “forced to take unilateral action.” A NATO spokeswoman in Kabul who spoke on the condition of anonymity said Saturday that the airstrike policy remains unchanged and that coalition troops can defend themselves. But it was unclear whether there have been additional airstrikes since Karzai’s demand.

Gates acknowledged that the coalition’s “military operations have at times impacted the Afghan people in unwelcome ways, from minor but grating inconveniences to, in some rare but tragic cases, civilians accidentally killed or injured — losses we mourn and profoundly regret.” He added that there is weariness in both Afghanistan and the United States about the costly and prolonged conflict. But he said there has been significant military progress against the Taliban, to the point that later this year “a successful opening with respect to reconciliation” with insurgents might be possible.

Gates’s trip to Afghanistan is, in part, a farewell tour. He plans to visit U.S. soldiers and Marines in the south and east, and he met Saturday with Gen. David Petraeus, the top U.S. commander in Afghanistan. The visit also comes ahead of President Obama’s decision on how many of the 100,000 U.S. troops here to begin withdrawing next month. The killing of Osama bin Laden, the long-hunted al-Qaeda chief, and the war’s exorbitant costs have boosted the case for those at the White House who are pushing for a smaller U.S. contingent focused more on counterterrorism operations than on a large nation-building counterinsurgency. Gates was an advocate of the 30,000-soldier increase that Obama ordered in late 2009.

Before his arrival in Afghanistan, Gates told reporters that although the war has been costly, budget concerns should not be the only consideration. “The most costly thing of all would be to fail,” he said.

Among the other pressing issues is the status of negotiations with the Taliban. The Obama administration has focused more attention on the issue in recent months, and State Department representatives have met with a Taliban official said to be close to leader Mohammad Omar in Qatar and Germany. Karzai’s government has long called for peace talks, but the U.S. military has been skeptical of the possibilities, seeking to weaken the insurgency through military operations in hopes of improving its bargaining position.

Also Saturday, four NATO soldiers were killed in an explosion in the eastern part of the country, according to an alliance statement. Last month, 57 coalition troops died in Afghanistan, the highest monthly total of the year so far, according to the Web site, which tracks military fatalities.