Cheney was unhurt in the attack, which was claimed by the Taliban and was the closest that militants have come to a top U.S. official visiting Afghanistan. At least one U.S. soldier, an American contractor and a South Korean soldier were among the dead, NATO said.
Cheney said the attackers were trying "to find ways to question the authority of the central government." The Taliban said Cheney was the target.
About two hours after the blast, Cheney left on a military flight for Kabul to meet with President Hamid Karzai and other officials, then left Afghanistan.
The vice president had spent the night at the sprawling Bagram Air Base, ate breakfast with the troops and met with Maj. Gen. David Rodriguez, the commander of U.S. troops in Afghanistan.
He was preparing to leave for a meeting with Karzai when the suicide bomber struck about 10 a.m., sending up a plume of smoke visible by reporters accompanying him. U.S. military officials declared a "red alert" at the base.
"I heard a loud boom," Cheney told reporters. "The Secret Service came in and told me there had been an attack on the main gate."
He said he was moved "for a brief period of time" to a bomb shelter on the base near his quarters. "As the situation settled down and they had a better sense of what was going on, I went back to my room," Cheney added.
Asked if the Taliban were trying to send a message with the attack, Cheney said: "I think they clearly try to find ways to question the authority of the central government."
"Striking at Bagram with a suicide bomber, I suppose, is one way to do that," he said. "But it shouldn't affect our behavior at all."
Maj. William Mitchell said it did not appear the explosion was intended as a threat to Cheney. "He wasn't near the site of the explosion," Mitchell said. "He was safely within the base at the time of the explosion."
CBS News correspondent Sheila MacVicar reports large numbers of Afghan civilians frequently gather at the gates to Bagram in the morning, hoping to get work for the day.
There were conflicting reports on the death toll. Karzai's office said 23 people were killed, including 20 Afghan workers at the base. Another 20 people were injured, it said.
NATO's International Security Assistance Force said initial reports were that three people were killed, including a U.S. soldier, an American contractor and a South Korean soldier. U.S. officials indicated they planned to update that death toll.
Associated Press reporters at the scene saw 12 bodies being carried in black body bags and wooden coffins from the base entrance into a market area where hundreds of Afghans had gathered to mourn.
Friends and relatives cried and moaned as they took the bodies away from the base. Two men came to the base entrance crying and wringing their hands, one of them screaming, "My brother!"
A message posted on a Web site used by militants said "a mujahid ... carried out a suicide attack in front of the second gate of the Bagram Air Base. ... The target was Bush's vice president, Dick Cheney."
A purported Taliban spokesman, Qari Yousef Ahmadi, said Cheney was the target of the attack, which Ahmadi said was carried out by an Afghan called Mullah Abdul Rahim, of Logar province.
"We knew that Dick Cheney would be staying inside the base," Ahmadi told AP by telephone from an undisclosed location. "The attacker was trying to reach Cheney."
Mitchell noted that Cheney's overnight stay occurred only after a meeting with Karzai on Monday was canceled because of bad weather.
"I think it's a far-fetched allegation," he said, referring to the Taliban claim. "The vice president wasn't even supposed to be here overnight, so this would have been a surprise to everybody."
Perino said President Bush got an update Tuesday morning about the attack, but had not yet spoken to Cheney about it. Bush was not awakened to be told about the attack, she said.
"Of course, we're glad that he's OK," Perino said of Cheney.
The explosion happened near the first of at least three gated checkpoints vehicles must pass through before gaining access to Bagram.
The base houses 5,100 U.S. troops and 4,000 other coalition forces and contractors. High security areas within the base are blocked by their own checkpoints. It was unclear how an attacker could expect to penetrate the base, locate Cheney and get close to him without detection.
Mitchell told CBS News in a telephone interview from Bagram that it appeared a lone bomber passed through an "open gate" at the perimeter of the well-fortified installation and then blew himself up when he reached security at an inner gate.
"We maintain a high level of security here at all times. Our security measures were in place and the killer never had access to the base," said Lt. Col. James E. Bonner, the base operations commander. "When he realized he would not be able to get onto the base, he attacked the local population."
Khan Shirin, a private security guard, sobbed near the body of his relative, Farvez, a truck driver and the representative of transport association that hauls goods for the base. Shirin said many of the people killed were truck drivers waiting to get inside.
Ajmall, a shopkeeper, said the "huge" blast shook a small market where he has a stall about 500 yards from the base. Ajmall, who goes by one name, said those wounded were taken inside the U.S. base for treatment.
South Korea's Defense Ministry said one of its troops stationed in Bagram, Sgt. Yoon Jang-ho, 27, was killed in the explosion. South Korea has about 200 engineers and medics in Bagram.
Cheney later flew by plane to Kabul, 30 miles south of Bagram, to meet Karzai after a planned meeting on Monday was canceled because of bad weather that prevented the vice president making the trip to the capital.
Cheney was met by guards with guns drawn on the tarmac and was rushed by ground convoy to the presidential palace, where he and Karzai walked a long receiving line and past oriental rugs laid out on the wet, stone pavement.
Cheney and Karzai met privately for an hour and spoke about the "problems coming from Pakistan," said an Afghan government official, a reference to cross-border infiltration by militants who launch attacks in Afghanistan.
"We understand now that the U.S. government realizes that in order to stop terrorism in Afghanistan and to stop terrorist attacks in Afghanistan, there must be a clear fight against terrorism in Pakistan," said the official, who spoke on condition of anonymity because of the sensitivity of the matter.
Visiting Pakistan before his Afghanistan trip, the vice president pressured Pakistan's President Musharraf to get more aggressive, reports CBS News national security correspondent David Martin. But according to Derek Chollet of the Center for Strategic and International Studies, U.S. options in Pakistan are nearing a dead end — even a disastrous end — if Musharraf were to fall.
"We're one bad event away from this going down the tubes, which is a dangerous position to be in, given how vital Pakistan is and Pakistan's stability is to U.S. interests, given the fact that Pakistan is a nuclear power," Chollet said.
Five years after their fundamentalist regime was toppled, Taliban-led militants have stepped up their attacks and Afghan, U.S. and NATO forces are bracing for a fresh wave of violence in the spring.
Such an attack, the closest militants have got to a top U.S. official visiting Afghanistan, will likely have propaganda value for the resurgent Taliban movement.
In January 2006, a militant blew himself up in Uruzgan province during a supposedly secret visit by the U.S. ambassador, killing 10 Afghans.
There were 139 suicide bombings last year, a fivefold increase over 2005, and Rodriguez has said he expects the number of suicide bombs to rise even further in 2007.
In the southern Afghan city of Kandahar, meanwhile, a suicide attacker targeting police blew himself up, wounding three people, said police officer Abdul Nafai.
NATO-led troops patrolling the city also fatally shot a civilian who drove too close to their convoy, police said, the third such fatal shooting this month. Squadron Leader David Marsh, a military spokesman, said soldiers had signaled for the car to stop, but it kept approaching.