Col. Steve Boylan said the retired general's affair started after Petraeus left the army.
He added that the affair with Paula Broadwell ended four months ago. Petraeus acknowledged the affair in a letter to CIA staff.
Col. Boylan said Mrs Petraeus "is not exactly pleased right now. Furious would be an understatement."
Col. Boylan said he spoke to Petraeus over the weekend and he was "devastated." He added: "it's going to take a long time" for him to set things straight at home.
The affair was discovered after Ms Broadwell sent threatening emails to Jill Kelly, whom she perceived to be her rival for Petraeus.
Ms Kelley, 37, is an unpaid social liaison officer to MacDill Air Force Base in Tampa, where the military's Central Command and Special Operations Command are located.
In a statement she and her husband, Scott, said: "We and our family have been friends with Gen. Petraeus and his family for over five years. We respect his and his family's privacy and want the same for us and our three children."
Meanwhile members of the US Congress have asked whether national security was compromised and why they were not told about the planned resignation sooner. "We received no advanced notice. It was like a lightning bolt," Democrat Dianne Feinstein, who heads the Senate Intelligence Committee.