Surveillance video from inside the courthouse shows the men wearing sombreros and waving a gavel.
The break-in triggered a heavy police response and closed downtown streets. Bomb-sniffing dogs and the FBI were brought to the scene, and the men were arrested at the courthouse at about 1:30 a.m.
After investigation, officials believe the men are not dangerous. A judge said it may have all been just a prank.
The men apparently rented an RV found outside the courthouse that was registered to Road Bear RV Rentals in Agoura Hills, but was rented from a company lot in New Jersey.
The identities or nationalities of the men weren't immediately released, but authorities said 90-day visas were found in their rented RV.
Bexar County Sheriff Amadeo Ortiz said some of them arrived in New York last month and drove the vehicle to Florida, where the others joined them.
The Associated Press contributed to this report.