FORT MEADE, Md. — Pfc. Bradley Manning on Wednesday apologized for leaking 700,000 government files to WikiLeaks, saying at the sentencing portion of his trial that while he “believed it was going to help people, not hurt people,” he now realized that it was wrong.

“I’m sorry,” Private Manning told the judge. “I’m sorry that my actions hurt people. I’m sorry that they hurt the United States. At the time of the decision, as you know, I was dealing with a lot of issues, issues that are ongoing.”

But while those issues — a reference to his crisis over his sexuality, which he was confronting while on a military deployment in a combat zone — have caused him considerable difficulties, he said, he was responsible for his actions.