LAS VEGAS (AP) - The leader of an occupation at an Oregon wildlife refuge last year has been released from U.S. custody during his Nevada trial over a 2014 armed standoff with U.S. agents near his father's ranch.

Ammon Bundy was greeted by family and cheering friends as he walked out of a federal courthouse in Las Vegas on Thursday. He has been behind bars for nearly two years and will now be under house arrest.

Timeline: Armed occupation in Eastern Oregon

A judge ruled Wednesday that Bundy; his father, Cliven Bundy; and a co-defendant could be released from jail while they stand trial. They've been charged in the Nevada standoff that stopped a federal roundup of Bundy cattle from public land.

Cliven Bundy refused the offer. Another son, Ryan Bundy, already was living at a halfway house while serving as his own attorney.