By Dan Whitcomb

(Reuters) - A federal judge on Tuesday rejected a petition by two brothers who led the armed occupation of a federal wildlife refuge in Oregon to be freed ahead of their trial, citing in part what he said was an aborted jailbreak attempt by one of them.

Ammon and Ryan Bundy, who spent a month in January holed up at the Malheur National Wildlife Refuge in Oregon to protest federal land control in the West, sought their release from custody during a hearing in U.S. District Court in Portland on Monday ahead of their September trial.

In rejecting that request in a three-page ruling, U.S. District Judge Robert Jones said he could not overlook their participation in the standoff with a large arsenal of weapons and their belief that "placing an armed force between officials seeking to enforce lawful orders and themselves is justified by their interpretation of the Constitution."

Both men are charged with conspiracy to use force, intimidation or threats to impede federal officers from discharging their duties.

Jones also said that Ryan Bundy, 43, presented a flight risk due to what prosecutors have said was a plan discovered in April to escape from the Multnomah County Detention Center.

"In Ryan Bundy's cell, jail personnel found a rope made with multiple sheets tied together, additional strips of torn sheets, extra pillow cases, towels, clothing and food," the judge wrote. "I reject his excuse that he was practicing braiding."

Ammon Bundy, 40, and his brother Ryan are among 26 people charged in connection with the Malheur takeover, which began on Jan. 2 and was sparked in part by the return to prison of two Oregon ranchers convicted of setting fires that spread to federal property in the vicinity of the refuge.

The occupation was also a protest against federal control of hundred of millions of acres of public land in the West.

At the conclusion of their trial in Oregon, Ammon and Ryan Bundy will face charges of assault on a federal agent, threatening an law enforcement officer, conspiracy and firearms violations in connection with a 2014 standoff in Nevada, which began when federal agents seized cattle from their father Cliven Bundy's ranch because of unpaid grazing fees.

Cliven Bundy, 70, is also charged in connection with that confrontation, which came to symbolize opposition to federal control of public lands in the West.

(Reporting by Dan Whitcomb; editing by Steve Orlofsky and G Crosse)