Defense Secretary Robert Gates made a surprise visit Friday to Iraq and expressed support for the top U.S. commander here, saying the military wasn't trying to paint an overly optimistic picture of how the war is going.

"It's a very mixed picture," Gates told reporters on his plane when asked whether the military and Gen. David Petraeus were offering realistic assessments of the violence in Baghdad, where the number of U.S. troops has been increased over the past few months.

"I have every confidence in General Petraeus and in his ability and willingness to call it as he sees it," Gates said.

Gates arrived in Baghdad late Friday night to meet with U.S. military and Iraqi political leaders. This is his fourth trip to the country since taking over as defense chief in December; his most recent stop here was in April.

The additional five U.S. combat brigades that make up the recent U.S. troop buildup are now all in Iraq, as part of an increased effort to stabilize the violence in Baghdad. Gates' visit came as Iraqi officials ordered a citywide security crackdown after the bombing Wednesday that toppled the two minarets of the Askariya mosque about 60 miles north of Baghdad.

Petraeus was criticized this week by Senate Majority Leader Harry Reid, who accused the top U.S. commander in Iraq and Gen. Peter Pace, chairman of the Joint Chiefs of Staff, of failing to provide Congress a candid assessment of the Iraq war.

The criticism comes just a week after lawmakers told Gates they would challenge Pace if he were nominated for a second two-year term as chairman, and so Gates decided to replace him.

Reid said Pace hadn't done a good job and he also said he was concerned about Petraeus, who told USA Today this week that there are "astonishing signs of normalcy" throughout the majority of Baghdad. Petraeus was quoted as saying, "I'm talking about professional soccer leagues with real grass field stadiums, several amusement parks, big ones, markets that are very vibrant."

Reid said the remark "gives you a feeling that he's not in touch with what is really going on in Iraq or just trying to make the president feel good."

Gates, on his way to Baghdad, defended Petraeus, saying he doesn't "pull any punches."

The Pentagon plans to focus this summer on calming Baghdad in hopes of enabling Iraqi leaders to pursue political reconciliation and stabilize the country, which now is divided among warring factions of Shiites, Sunnis and Kurds.

Congress, in approving continuing funding for the war, required President Bush to report to lawmakers by September on whether the "surge" in U.S. troops is allowing satisfactory progress on the ground in Iraq, including approval of oil revenue sharing legislation and other steps.

Gates told reporters that he believes military leaders should have a good "sense" by the end of the summer of the direction the country is going, but it's too soon to say whether there will be success. "It remains to be seen where we'll be in September," he said on his plane, which landed at Baghdad's International Airport.

He said he would deliver to Iraqi leaders the same message he did in April -- that the U.S. military is here to buy Iraqis time to pursue reconciliation and stabilize the country.

He said he hopes this week's mosque bombings will not disrupt the progress so far.