Officials said a jail inmate walked out of a Dallas courthouse when a water main break forced an evacuation of the building Thursday afternoon.

The Dallas County Sheriff's Department said 17-year-old Juan Ramires escaped the Frank Crowley Courts Building just before 2 p.m.

When a pipe burst in the courthouse Thursday afternoon, trustee inmates were used to help clean up the mess. Sheriff Lupe Valdez said Ramires was approved to work in public.

A water main burst in one of the electrical rooms on the first floor of the courthouse. The flood knocked out power to the elevators and escalators, the sprinkler system and the fire alarms.

"The decision was made for life safety to go ahead and shut down the building," Valdez said.

Officials said Ramires managed to slip away and flee through the north exit as everyone in the courthouse was being evacuated.

The sheriff's department said Ramires was being held on a misdemeanor charge of failure to provide ID and evading arrest.

Warrant squads from the Dallas County Sheriff's Department are searching for Ramires. Anyone with information on his location is asked to call 214-653-2703.

The Frank Crowley Courts Building will be closed to the public until Monday because of the flooding.

The closure does not affect the George Allen Civil Courts Building or the Lew Sterrett Complex.

NBC 5's Ellen Goldberg contributed to this report.