Washington (CNN) -- The commander of U.S. forces in Iraq and Afghanistan was escorted from a congressional hearing room after fainting during a Senate Armed Services Committee hearing Tuesday, his spokesman said.

Gen. David Petraeus "is feeling much better," spokesman Col. Erik Gunhus said. "It appeared that he fainted."

A doctor checked Petraeus out and he returned to the hearing room to continue, but committee chairman Sen. Carl Levin "overruled him," Gunhus said. "Looks like we will continue tomorrow. He will be OK."

Petraeus returned amid applause to the hearing room. On his way out of the building, Petraeus told CNN's Dana Bash, "I'm doing OK. I just got a little dehydrated. I ate a couple of bananas and drank some water. I didn't eat breakfast this morning."

Petraeus is the head of U.S. Central Command, which oversees the conduct of the U.S. wars in the Middle East and central Asia.

Pentagon spokesman Geoff Morrell said Petraeus was examined by a doctor in an outer room.

"They gave him some fruit and juice to get his blood sugar up and did all the tests you would do in the aftermath of an unusual episode like that," Morrell said. "He took some time, is feeling better and wanted to go back out to complete the hearing."

President Barack Obama called Petraeus from Air Force One while the president was en route back from Pensacola, Florida, a White House spokesman said.

Obama got the impression, from his talk with Petraeus, that he is "doing great," deputy White House press secretary Bill Burton told reporters. "Sounds like he was just a little dehydrated," Burton said.

A Pentagon official added that Petraeus "goes nonstop and has kept his schedule like this for nine years. I don't know if it was the schedule and pace at which he drives himself contributed to this. He indicated he didn't have breakfast or anything to eat or drink. He is back at the Pentagon working. He did not go for further medical tests."

Gunhus said, "We have just returned from a weeklong overseas trip to Jordan and London and I think he was just dehydrated. He will be OK. We are back at the Pentagon working and executing his afternoon schedule."

Before Petraeus was escorted out, key senators questioned the progress and planning for U.S. efforts in Afghanistan.

Opening the hearing, Levin, D-Michigan, questioned the ratio of U.S. and NATO troops to Afghan troops, urging a faster ramping up of Afghan security forces.

"Progress towards the goal of Afghans taking the lead in operations has been unsatisfactory. Today operations in Afghanistan are excessively dependent on coalition forces," Levin said.

Levin said in the coming campaign in Kandahar, there is a plan to have one Afghan service member for every two international troops. He called instead for a one-to-one ratio, with Afghan forces in the lead.

His Republican counterpart, Sen. John McCain, R-Arizona, said in his opening remarks that the key trends were going in a "bad direction, perhaps even signaling a mounting crisis."

"Hoping for success on the arbitrary timeline set by the administration is simply unrealistic," McCain said, calling for the president to say the U.S. will stay in Afghanistan until there is success.

Moments before Petraeus' fainting spell, McCain asked him about the president's target to begin withdrawal of the additional troops by July of next year.

"July 2011 is not the date where we race for the exits. It is the date where, having done an assessment, we begin a process of transition of tasks to Afghan security forces based on conditions and begin a process of, quote, a responsible drawdown of our forces," Petraeus explained.

McCain expressed doubts about the timetable, as he has before. The Arizona senator worried that people in the region will assume America is leaving and that will strengthen the hand of the Taliban.

"You believe that we can begin a drawdown in July of 2011, under the projected plans that we have?" McCain asked.

"That is the policy and I support it," Petraeus said.

"I understand you support the policy," McCain responded. "Will conditions on the ground indicate that we will begin a withdrawal, in the words of the vice president: 'July of 2011, you're going to see a whole lot of people moving out, bet on it'?"

McCain moved on to another topic before Petraeus could answer the question. A few moments later, the hearing was recessed until Wednesday morning.

Prepared remarks from Petraeus said progress is being made even as the security violence has gotten more intense.

The surge of U.S. troops into Afghanistan is ahead of schedule, but the situation on the ground will get more difficult before it gets better, he warned in the prepared remarks. "I noted several months ago ... the going was likely to get harder before it got easier. That has already been the case, as we've seen recently."

All 30,000 additional U.S. troops ordered by Obama last year will be in place in Afghanistan by the end of August, according to Petraeus. Troops had originally been scheduled to be in place by September.

In the prepared remarks, he told the congressional panel Tuesday that increasing the size and capability of the struggling Afghan National Army and police forces are back on track, but there is more work to be done.

Undersecretary of Defense Michele Flournoy also argued that progress has been made.

"We are regaining the initiative and the insurgency is beginning to lose momentum," she said in her opening statement, but noted the outcome is "far from determined."