KABUL, Afghanistan -- Gen. David Petraeus prepared to formally assume command Sunday of a 130,000-strong international force in Afghanistan at a time of rising casualties and growing doubt about the nine-year war.

June was the deadliest month for the allied force since the war began in October 2001 with 102 deaths, more than half of them Americans. Britain's Ministry of Defense reported that a Royal Marine was killed Thursday in southern Afghanistan -- the fifth international service member killed this month.

Petraeus called for troops and civilian staff employees to work together, saying, "In this important endeavor, cooperation is not optional."

His predecessor, Gen. Stanley McChrystal, was fired last month for intemperate remarks he and his aides made to Rolling Stone magazine about Obama administration officials, mostly on the civilian side.

"Civilian and military, Afghanistan and international, we are part of one team with one mission," Petraeus told about 1,700 invited guests, including Afghan government and military and police officials gathered at the U.S. Embassy for a pre-Fourth of July celebration marking American independence.

They were Petraeus' first public comments since he arrived Friday night to take command of U.S. and NATO forces in Afghanistan. He said he would work to improve coordination between troops on the battlefield and civilians trying to bolster the Afghan government and improve the lives of the people.

His message to the Afghans in the audience: "Your success is our success."

Petraeus, widely credited with turning around the U.S. war effort in Iraq, faces rising violence and growing doubts in Washington and other allied capitals about the effectiveness of the counterinsurgency strategy, which the general himself pioneered.

Later, Petraeus met with Afghan President Hamid Karzai. Corruption was one of the issues the two discussed, according to a statement issued by the presidential palace. Karzai used the meeting to complain about what he said were "baseless" allegations made by U.S. Rep. Nita Lowey, a Democrat from New York, who suggested Afghan government officials had misused or pocketed donor funds, Karzai's office said.

Karzai asked Petraeus to review international contracts for private security companies to help keep money from flowing out of the country. According to the statement, Petraeus told the president he would begin his job by emphasizing "unity, accountability and transparency."

The gathering was upbeat. A rock band played. Dignitaries sat in tents eating popcorn, hamburgers, and ice cream. The positive tone, however, was dampened by talk of Friday's attack on a four-story house used by an American aid organization in the northern city of Kunduz, and the accidental killing of civilians during a raid in the south.

Taliban suicide attackers stormed the house, killing four people before dying in a five-hour gunbattle with Afghan security forces. The pre-dawn attack appeared part of a militant campaign against international development organizations at a time when the U.S. and its allies are trying to accelerate the civilian aid effort to turn back the Taliban.

During the picnic, NATO issued a statement acknowledging the deaths Friday of two Afghan civilians, including a woman, in a joint raid with Afghan troops to arrest a Taliban deputy commander in the Kandahar area.

During the raid, an Afghan man left a compound and "demonstrated hostile intent," NATO said. Troops opened fire, wounding him. When troops entered the compound, they found an Afghan woman dead from stray rounds and another man wounded, the alliance said. One of the two wounded men later died.