By Lily Kuo

FORT MEADE, Maryland (Reuters) - A U.S. military judge refused on Thursday to throw out a charge that Bradley Manning, the U.S. intelligence analyst accused of leaking government files to the anti-secrecy website WikiLeaks, aided the enemy, identified as al Qaeda.

The charge could result in a life prison sentence if Manning, 24, is convicted at a court-martial in September.

Manning is charged with leaking hundreds of thousands of U.S. government cables and field reports from Iraq and Afghanistan to WikiLeaks in 2010, in the largest leak of classified documents in U.S. history.

Prosecutors say the leaks helped "al Qaeda in the Arabian Peninsula," one of the militant group's most potent affiliates.

"The defense motion to dismiss ... is denied," military Judge Colonel Denise Lind said in a pretrial hearing, adding that if prosecutors could not prove in the trial phase that Manning knew intelligence given to WikiLeaks would reach enemy hands, the court would "provide appropriate motions."

Manning's attorney, David Coombs, had pressed the court to dismiss the charge. Comparing Manning's actions to that of a soldier speaking to a major newspaper, he argued that without an intent to provide information to the enemy, Manning's actions constituted at most negligence.

The ruling was another blow for Manning, who made several appeals over three days of pretrial hearings this week to reduce or dismiss all 22 charges against him. Those motions were all rejected.

Aiding the enemy is a capital offense, but the prosecution has said it would not seek the death penalty in Manning's case if he is found guilty.

Prosecutors accuse Manning of downloading more than 700,000 classified or confidential files from the military's Secret Internet Protocol Router Network, or SIPRNet, while serving in the Army's 10th Mountain Division in Iraq.

Manning also faces charges of stealing records belonging to the United States and wrongfully causing them to be published on the Internet.

(Editing by Peter Cooney)