Dempsey, who was in his room during the attack, was not hurt in the blast. Two maintenance people working nearby sustained minor injuries.
The attack occurred a little after midnight local time at the U.S. military base outside Kabul when Dempsey's C-17 plane was hit by fragments of indirect fire from two rockets, a military official told ABC News.
The C-17 had small holes above the crew door, in the fuselage to the left of the door and in one of the engine coverings.
Because of the exterior damage to the aircraft, Dempsey and his team left Bagram on a different C-17 plane. The attack also caused slight damage to an Apache helicopter that was parked nearby.
Dempsey was in Afghanistan to discuss the state of the war after a particularly deadly few weeks for Americans in the more than 10-year-old Afghan war. Nineteen U.S. troops and one aid worker have been killed in Taliban attacks in the past two weeks, nine of them shot to death in cold blood by rogue Afghan soldiers or policemen.
At least 36 foreign troops have been killed this year in "green-on-blue" attacks. The Taliban often claim responsibility for the attacks, and a recent video produced by their multimedia wing showed a rogue Afghan soldier receiving a hero's welcome after killing two U.S. soldiers.
The Associated Press contributed to this report.