Flanked by his lawyers, Manning, 25, stood at attention in his dress uniform and showed no reaction when military judge Col. Denise Lind announced the punishment without explanation during a brief hearing.
Among the spectators, there was a gasp, and one woman put her hands up, covering her face.
"I'm shocked. I did not think she would do that," said Manning supporter Jim Holland, of San Diego. "Thirty-five years, my Lord."
The former intelligence analyst was found guilty last month of 20 crimes, including six violations of the Espionage Act, as part of the Obama administration's unprecedented crackdown on media leaks. The judge acquitted him of the most serious charge, aiding the enemy, an offense that could have meant life in prison without parole.
Manning could have gotten 90 years behind bars. Prosecutors asked for at least 60 as a warning to other soldiers, while Manning's lawyer suggested he get no more than 25, because some of the documents he leaked will be declassified by then.
He will get credit for the more than three years he has been held but will have to serve at least one-third of his sentence before he is eligible for parole. He was also demoted to private and dishonorably discharged.
After the judge pronounced sentence, guards hurried Manning out of the courtroom as about a half-dozen supporters shouted from the back: "We'll keep fighting for you, Bradley!" and "You're our hero!"
Prosecutors had no immediate comment, while the American Civil Liberties Union, Amnesty International and other activists decried the punishment.
"When a soldier who shared information with the press and public is punished far more harshly than others who tortured prisoners and killed civilians, something is seriously wrong with our justice system," said Ben Wizner, head of the ACLU's speech and technology project.
Manning digitally copied and released more than 700,000 documents, including Iraq and Afghanistan battlefield reports and State Department cables, while working in 2010 in Iraq.
The Crescent, Okla., native also leaked video of a 2007 Apache helicopter attack in Baghdad that mistakenly killed at least nine people, including a Reuters photographer.
A potentially more explosive leak case unfolded as Manning's court-martial was underway, when former National Security Agency contractor Edward Snowden was charged with espionage for exposing the NSA's Internet and telephone surveillance programs.
At his trial, Manning said he gave the material to the secrets-spilling website WikiLeaks to expose the U.S. military's "bloodlust" and generate debate over the wars and U.S. policy.
During the sentencing phase, he apologized for the damage he caused, saying, "When I made these decisions, I believed I was going to help people, not hurt people."
His lawyers also argued that Manning suffered extreme inner turmoil over his gender identity -- his feeling that he was a woman trapped in a man's body -- while serving in the macho military, which at the time barred gays from serving openly. Among the evidence was a photo of him in a blond wig and lipstick.
Defense attorney David Coombs told the judge that Manning had been full of youthful idealism and "really, truly, genuinely believed that this information could make a difference."
Prosecutors showed that al-Qaida used material from the helicopter attack in a propaganda video and that Osama bin Laden presumably read some of the leaked documents. Some of the material was found in bin Laden's hideout after he was killed.
Also, government witnesses testified the leaks endangered U.S. intelligence sources, some of whom were moved to other countries for their safety. And several ambassadors were recalled, expelled or reassigned because of embarrassing disclosures.
Prosecutors called Manning an anarchist and an attention-seeking traitor, while supporters have hailed him as a whistleblower and likened him to Daniel Ellsberg, the defense analyst who in 1971 leaked the Pentagon Papers, a secret history of U.S. involvement in Vietnam, to The New York Times and other newspapers.
That case touched off an epic clash between the Nixon administration and the press and led to a landmark Supreme Court ruling on the First Amendment.
In a telephone interview after Manning's sentencing, Ellsberg called the soldier "one more casualty of a horrible, wrongful war that he tried to shorten."
"I think his example will always be an inspiration of civil and moral courage to truth tellers in the future," Ellsberg said.
The Obama administration has charged seven people with leaking to the news media, while only three people were prosecuted in all previous administrations combined.
Among those seven is Snowden, whose leak has triggered a fierce debate over security vs. privacy and strained U.S. relations with Russia, which is harboring him despite demands he be returned to this country to face charges.
A lawyer for WikiLeaks founder Julian Assange, Michael Ratner, has suggested Manning's conviction could make it easier for federal prosecutors to get an indictment against Assange as a co-conspirator.
But other legal experts said the Australian's status as a foreigner and a publisher make it unlikely he will be indicted.
Take ABC13 with you!
Download our free apps for iPhone, iPad, and Android devices