By Tom Ramstack

FORT MEADE, Maryland (Reuters) - Assessing the breach of the largest leak of classified data in U.S. history cost the military hundreds of thousands of dollars, a retired Army officer on Wednesday told the judge weighing the length of time soldier Bradley Manning will spend in prison.

Retired Colonel James McCarl said the release of hundreds of thousands of diplomatic cables, battlefield videos and other classified data on the WikiLeaks pro-transparency website prompted a flurry of activity as officials scrambled to assess the potential degree of impact on wars in Iraq and Afghanistan.

Colonel Denise Lind, the military judge hearing Manning's court-martial, last week convicted the 25-year-old Army private first class on 19 charges that included espionage and theft. Manning was working as a low-level intelligence analyst in Baghdad more than three years ago when he was arrested and accused of releasing more than 700,000 secret documents to WikiLeaks.

McCarl said commanders were concerned that enemy fighters might use the information released in 2010 to hone their strategies against the United States.

An initial military review included assigning personnel to read the first 2,000 documents in a set of 110,000 that might include military information, then write a computer program to sort through them, said McCarl, who oversaw part of the review.

The program would weigh the importance of batches of the documents.

"Our calculation is that we spent 855 man-hours, which equates to roughly about $200,000 to do all that work," McCarl said.

Manning faces up to 90 years in prison. The sentencing phase of the court-martial began last week and is expected to last at least until Friday.

Manning was found not guilty of the most serious charge of aiding the enemy, which carried the threat of life in prison without parole. His lawyers portrayed the slightly built soldier as naive but well intentioned, and argued that his aim was to provoke a broader debate on U.S. military policy, and not to harm anyone.

During the session of the hearing open to media and the public, McCarl did not say whether the WikiLeaks publications might have increased battle risks to American soldiers. Instead, the court went into a closed session to hear the rest of McCarl's testimony.

Manning's court-martial has drawn international scrutiny, and the trove of documents he provided catapulted WikiLeaks and its founder, Julian Assange, into the spotlight.

Access to classified information remains a sensitive subject after Edward Snowden, a U.S. intelligence contractor, this summer revealed the super-secret National Security Agency program to collect phone and Internet records.

(Editing by Ian Simpson and Gunna Dickson)