FORT MEADE, Md. — A military judge sentenced Pfc. Bradley Manning on Wednesday to 35 years in prison for providing more than 700,000 government files to WikiLeaks, a gigantic leak that lifted the veil on American military and diplomatic activities around the world.

The sentence is the longest ever handed down in a case involving a leak of United States government information for the purpose of having the information reported to the public. Private Manning, 25, will be eligible for parole in about seven years, his lawyer said.

In a two-minute hearing on Wednesday morning, the judge, Col. Denise R. Lind of the Army, also said that Private Manning would be dishonorably discharged and reduced in rank from private first class to private, the lowest rank in the military. She said he would forfeit his pay, but she did not impose a fine.

Before the sentencing, Private Manning sat leaning forward with his hands folded, whispering to his lawyer, David Coombs. His aunt and two cousins sat quietly behind him. As Colonel Lind read the sentence, Private Manning stood, showing no expression. He did not make a statement.