Hillary Clinton's spokesman has launched a public attack on the Pentagon for the way it is treating military prisoner Bradley Manning, the US soldier suspected of handing the US embassy cables to WikiLeaks.

PJ Crowley, the assistant secretary of state for public affairs at the US state department, said Manning was being "mistreated" in the military brig at Quantico, Virginia. "What is being done to Bradley Manning is ridiculous and counterproductive and stupid on the part of the department of defence," he said.

Crowley's comments signal a crack within the Obama administration over the handling of the WikiLeaks saga in which hundreds of thousands of confidential documents were handed to the website.

As news of the remarks rippled through Washington, President Obama was forced to address the subject of Manning's treatment for the first time.

Asked about the controversy at a White House press conference, Obama revealed he had asked the Pentagon "whether or not the procedures that have been taken in terms of his confinement are appropriate and are meeting our basic standards. They assure me that they are."

Obama would not respond specifically to Crowley's comments, which are the first critical remarks from within the administration about the handling of Manning. The prisoner is being held for 23 hours in solitary confinement in his cell and stripped naked every night.

Until now the US government had presented a united front, promising to aggressively pursue anyone involved in leaking state secrets. Clinton herself described the WikiLeaks material as "an attack on America" and said "we are taking aggressive steps" to hold those who leaked it to account.

Manning has been charged with handing state secrets to an unauthorised party. The charges include aiding the enemy, which can carry the death penalty.

Crowley, speaking at an MIT seminar in Boston, did say he believed Manning was "in the right place". He was presumably referring to Quantico, where the intelligence specialist has been held pending a court martial since July last year.

Crowley said: "There is sometimes a need for secrets for diplomatic progress to be made." But when asked by one of the audience what he thought about the "elephant in the room" – the US "torturing a prisoner in a military brig" – he replied without pausing that he thought the Pentagon's actions were "ridiculous and counterproductive and stupid".

Details of Crowley's comments, which he said were on the record, were posted on the personal blog of Philippa Thomas, a BBC news correspondent on sabbatical doing a Nieman journalism fellowship at Harvard. The remarks were corroborated by another blogger at the seminar. The comments are likely to encourage protesters who have maintained steady pressure on the Pentagon.

The UN is investigating whether the treatment amounts to torture.

This week, in a legal letter, Manning gave his own description of conditions in the brig. "The determination to strip me of all my clothing every night since 2 March 2011 is without justification and therefore constitutes unlawful pretrial punishment," he wrote. The 11-page legal letter provided a rare insight into the state of mind of the prisoner, who has been held in solitary confinement for 10 months.

After he was arrested in Iraq in May, he was initially held in Kuwait before being transferred to Quantico in July. Manning says in the letter that he is being "left to languish under the unduly harsh conditions of max [security] custody".

He describes being stripped and made to stand naked for inspection. "The guard told me to stand at parade rest, with my hands behind my back and my legs spaced shoulder-width apart. I stood at parade rest for about three minutes. The [brig supervisor] and the other guards walked past my cell. He looked at me, paused for a moment, then continued to the next cell. I was incredibly embarrassed at having all these people stare at me naked."

Manning and his lawyer David Coombs have been trying to convince the military authorities that he is psychologically healthy and does not need such a harsh regime. His supporters argue the treatment is punitive and designed to force him into a coerced confession.