A federal judge on Thursday sentenced David H. Petraeus, a former C.I.A. director and the highest-profile general from the wars in Iraq and Afghanistan, to two years’ probation for providing classified information to a woman with whom he was having an affair.
Mr. Petraeus was also fined $100,000, more than double the amount the Justice Department had requested.
The sentencing was a disappointing one for F.B.I. officials, who believed that Attorney General Eric H. Holder Jr. had given Mr. Petraeus preferential treatment by allowing him to plead guilty to a misdemeanor and recommending that he receive probation instead of prison time. Federal judges are not bound by such recommendations, but they almost always follow them.
Although the judge overseeing the case, David C. Keesler of United States District Court for the Western District of North Carolina, agreed to the probation sentence, he added $60,000 to the government’s suggested fine of $40,000. Judge Keesler did not give an extensive explanation for why he raised the fine, saying it was necessary because of “the seriousness of the offense.”
But he appeared unsatisfied earlier in the hearing when lawyers for Mr. Petraeus and federal prosecutors said that the amount they had come up with “wasn’t scientific,” and that they could not explain how they had settled on it.
For much of the hearing, Mr. Petraeus, 62, sat at a long table in front of the judge, flanked by David Kendall, one of the most respected and highly paid defense lawyers in Washington, and two junior lawyers. He stood briefly several times to answer questions from Judge Keesler, including when he made a short statement near the end of the hearing.
“I want to take this opportunity to apologize to those closest to me and others, including this court, for the pain my actions have caused,” Mr. Petraeus said.
As part of the plea agreement, Mr. Petraeus admitted that he gave his lover, Paula Broadwell, who was writing a biography about him, black notebooks that contained sensitive information about official meetings, war strategy and intelligence capabilities, as well as the names of covert officers.
According to court documents, he discussed the black books during an interview that Ms. Broadwell taped with Mr. Petraeus while she was working on the biography, telling her, “They are highly classified, some of them.”
Three weeks later, he gave her the notebooks.
In 2012, the F.B.I. opened a cyberstalking investigation after a friend of Mr. Petraeus’s reported to the authorities that she was receiving threatening messages from someone who appeared to know a lot about Mr. Petraeus’s whereabouts. It was later revealed that the person sending the messages was Ms. Broadwell.
During that investigation, Mr. Petraeus was questioned by F.B.I. agents at the C.I.A. headquarters, where he was serving as director. As part of his plea, Mr. Petraeus admitted that he misled the agents by telling them that he had not given Ms. Broadwell classified information.
Three days after President Obama was re-elected in November 2012, Mr. Petraeus resigned, admitting to the affair but saying he had done nothing illegal.
Mr. Petraeus had been a vocal advocate for the close protection of classified information by government officials. “Oaths do matter,” he said in October 2012 after a C.I.A. officer accepted a plea agreement for disclosing sensitive information, “and there are indeed consequences for those who believe they are above the laws that protect our fellow officers and enable American intelligence agencies to operate with the requisite degree of secrecy.”
The officer later received a 30-month sentence.
Mr. Petraeus’s lawyers have argued that the disclosure of the notebooks to Ms. Broadwell was not as severe as the misdeeds of others whom the Obama administration has prosecuted in a crackdown on leaks, because the information was never made public. But some in the F.B.I. and the Justice Department contended that Mr. Holder’s treatment of Mr. Petraeus represented a double standard, arguing that if he had been a lower-level official, he almost certainly would have gone to prison.
F.B.I. officials were particularly angry over what they viewed as Mr. Holder’s not backing up their agents and allowing Mr. Petraeus to get away with lying to them. For all the high-profile national security, cybercrime and organized crime cases that the bureau leads, its officials believe that its most important function is the ability to gather accurate information from the public.
To protect that function, the Justice Department routinely prosecutes terrorists, politicians, drug dealers and even celebrities. In 2007, the track star Marion Jones was sentenced to six months in prison for making false statements to the federal authorities.
At the beginning of the hearing, the judge asked Mr. Petraeus a series of questions about whether he understood the plea agreement. As part of those questions, the judge asked whether he thought he had received adequate legal representation.
“It has been superb,” Mr. Petraeus said.