WASHINGTON — CIA director David Petraeus resigned Friday and admitted having an extramarital affair, bringing a shocking end to his brief tenure at the spy agency and highly decorated national security career.The investigation uncovered emails describing an affair between Petraeus and Paula Broadwell, a former military officer and co-author of a glowing biography of Petraeus, according to two law enforcement officials who were briefed on the investigation. The FBI began monitoring Petraeus' emails after being alerted that Broadwell may have had access to his personal email account, the officials said.Petraeus, a retired four-star Army general who once was seen as a potential presidential candidate, met with President Barack Obama on Thursday and said he intended to step down because of the affair, Obama administration officials said. The president accepted his resignation Friday."After being married for over 37 years, I showed extremely poor judgment by engaging in an extramarital affair," Petraeus, who turned 60 Wednesday, said in a statement distributed to the CIA workforce."Such behavior is unacceptable, both as a husband and as the leader of an organization such as ours," he said.The investigation is not expected to result in any accusations of criminal wrongdoing by Petraeus or Broadwell, the two law enforcement officials told the Washington Post.Paul Bresson, an FBI spokesman, refused to comment. Attempts to reach Broadwell were unsuccessful.In a statement, Obama said Petraeus has "provided extraordinary service to the United States for decades," adding that "through his lifetime of service David Petraeus has made our country safer and stronger."The statement did not directly address Petraeus' reason for resigning, but the president said that his "thoughts and prayers are with Dave and Holly Petraeus, who has done so much to help military families through her own work. I wish them the very best at this difficult time."Holly Petraeus is an assistant director of the U.S. Consumer Financial Protection Bureau, where she is charged with advocating on behalf of service members and their families. She and her husband met in 1973 at the U.S. Military Academy, where her father was superintendent.Broadwell, who also is married, is a West Point graduate and a research associate at Harvard University. She is the co-author of All In: The Education of General David Petraeus.In earlier interviews, Broadwell described meeting Petraeus in 2006 at Harvard, where she was working on a dissertation about leadership. She said they soon started emailing and discussing her research.In the preface to the book, Broadwell said that after Obama picked Petraeus to lead U.S. forces in Afghanistan in June 2010, he invited her to Kabul and she decided to turn her dissertation into a biography. She made repeated trips to Afghanistan to spend time observing Petraeus.In describing Petraeus in a CBS News interview two months ago, she said: "He, at the end of the day, is human and is challenged by the burdens of command. So, he has this mask of command — you think he's really confident — but I got to see a more personal side. He's confident, but he's also very compassionate about the loss of troops and sacrifices we're making in Afghanistan."Petraeus was scheduled to testify next week on Capitol Hill in hearings on the deaths of four Americans in Libya in September.U.S. officials insisted that the controversy surrounding the attack played no role in Petraeus' decision to resign.The nature of his resignation is likely to leave a stain on a polished 37-year military career. Petraeus was widely credited with helping to reverse the course of the war in Iraq and overhauling the military's approach to counterinsurgency fighting. He was later handed command of the war in Afghanistan, where success proved more elusive.Petraeus presided over an expansion of the CIA's Predator drone campaign in Yemen. He was involved in decisions to carry out controversial strikes, including the Predator attacks last year that killed two U.S. citizens: the al-Qaida figure Anwar al-Awlaki and his teenage son.