Washington (CNN) -- P.J. Crowley abruptly resigned Sunday as State Department spokesman over controversial comments he made about the Bradley Manning case.

Sources close to the matter said the resignation, first reported by CNN, came under pressure from the White House, where officials were furious about his suggestion that the Obama administration is mistreating Manning, the Army private who is being held in solitary confinement in Quantico, Virginia, under suspicion that he leaked highly classified State Department cables to the website WikiLeaks.

Speaking to a small group at MIT last week, Crowley was asked about allegations that Manning is being tortured and kicked up a firestorm by answering that what is being done to Manning by Defense Department officials "is ridiculous and counterproductive and stupid."

Crowley did add that "nonetheless, Bradley Manning is in the right place" because of his alleged crimes, according to a blog post by BBC reporter Philippa Thomas, who was present at Crowley's talk.

"The unauthorized disclosure of classified information is a serious crime under U.S. law," Crowley said in a statement Sunday. "My recent comments regarding the conditions of the pre-trial detention of Private First Class Bradley Manning were intended to highlight the broader, even strategic impact of discreet actions undertaken by national security agencies every day and their impact on our global standing and leadership.

"The exercise of power in today's challenging times and relentless media environment must be prudent and consistent with our laws and values," Crowley said. "Given the impact of my remarks, for which I take full responsibility, I have submitted my resignation."

Crowley has told friends that he is deeply concerned that mistreatment of Manning could undermine the legitimate prosecution of the young private. Crowley has also made clear he has the Obama administration's best interests at heart because he thinks any mistreatment of Manning could be damaging around the world to President Obama, who has tried to end the perception that the United States tortures prisoners.

Nevertheless, Crowley's political fate was sealed Friday when Obama was asked at a White House news conference about his comments regarding Manning.

Obama revealed that he had asked Pentagon officials "whether or not the procedures that have been taken in terms of (Manning's) confinement are appropriate and are meeting our basic standards."

In a comment that drew howls of protest from liberals, Obama added that Pentagon officials "assure me that they are. I can't go into details about some of their concerns, but some of this has to do with Private Manning's safety as well."

Manning's treatment has become a flashpoint for liberals, with Amnesty International noting he has been confined to a windowless cell for 23 hours a day, is stripped down to his boxers at night and is not given pillows or blankets.

Manning's lawyer also says the young private recently had to sleep in the nude because defense officials thought there was a suicide threat and decided to take away his boxer shorts.

Crowley is highly respected on foreign policy matters, dating back to his time as National Security Council spokesman under then-President Bill Clinton. He has been the Obama administration's public face on many international stories as the daily briefer at the State Department for Secretary Hillary Clinton.

But he has not had a completely smooth relationship with officials in the Obama White House, and eyebrows were raised several months ago when White House aide Mike Hammer was sent over to the State Department to serve as Crowley's deputy.

A senior White House official stressed that Crowley's exit was in the works for months and said the MIT incident only "hastened that departure."

"Everybody likes P.J. This was more a situation where it wasn't the right fit," said the official, noting there were times when Crowley wasn't on the same page as Clinton, let alone the White House.

Hammer will replace Crowley as the assistant secretary for public affairs, Clinton said in a statement Sunday.

She said she accepted Crowley's resignation "with regret."

"P.J. has served our nation with distinction for more than three decades, in uniform and as a civilian," she said. "His service to country is motivated by a deep devotion to public policy and public diplomacy, and I wish him the very best."

A little-known factor in Crowley's comments about Manning was revealed Saturday by April Ryan, a White House correspondent for American Urban Radio who covered Crowley in the Clinton White House.

Ryan wrote on Twitter that Crowley "dislikes treatment of prisoners as his father was a Prisoner of War."

While it's true that Crowley's father was imprisoned during World War II, people close to him downplay that as a major factor in his comments about Manning, saying the biggest factor is simply that Crowley believes what he said.

In his statement, Crowley said he leaves with "great admiration and affection" for his colleagues and "deep respect for the journalists who report on foreign policy and global developments every day, in many cases under dangerous conditions and subject to serious threats. Their efforts help make governments more responsible, accountable and transparent."