He had just arrived there in 2003 as a division commander, he said at a Pentagon news conference, when he clambered aboard a Humvee and asked the driver where he was from. “And I slapped the turret gunner on the leg and I said, ‘Who are you?’ “ General Dempsey recalled. “And she leaned down and said, ‘I’m Amanda.’ ”

As people chortled, General Dempsey continued: “And I said, ‘Oh, O.K.’ So a female turret gunner is protecting a division commander. And it’s from that point on that I realized something had changed, and it was time to do something about it.”

Almost a decade later, General Dempsey and Mr. Panetta signed a document formally rescinding a 1994 ban that restricted women from infantry, artillery, armor and other such combat roles. “Not everyone is going to be able to be a combat soldier,” Mr. Panetta said, “but everyone is entitled to a chance.”