Last fall, two newly minted female lieutenants joined about 100 men in Quantico, Va., for one of the most grueling experiences that soldiers not in war can experience: the Marine Corps’ Infantry Officer Course.

During the 86-day course, candidates haul heavy packs and even heavier weapons up and down steep hills, execute ambushes and endure bitter cold, hunger and exhaustion. Uncertainty abounds: they do not know their next task, or even how long they will have to perform it. At I.O.C., calm leadership under duress is more important than physical strength, although strength is essential.

One of the women — the first to enter the course — was dropped on the first day with about two dozen men during a notoriously strenuous endurance test. But the second woman lasted deep into the second week, when a stress fracture in her leg forced her to quit.

“She was tough,” Gen. James F. Amos, the Marine Corps commandant, said of the woman, who is now at flight school. “She wasn’t going to quit.”