A judge ruled that he must be given a prompt bond hearing.
Ruben Torres Maldonado has been in custody since last Saturday. DHS says he's been living in the U.S. illegally for years.
His 16-year-old daughter is undergoing cancer treatment, family members said.
A federal judge ruled that Maldonado's detention is unlawful and he must have a bond hearing on or before Oct. 31.
The case was in court Thursday.
The Department of Homeland Security says the man has a history of driving offenses, including driving without a valid license and speeding.
Assistant CHS Secretary Tricia McLaughlin issued the following statement this week:
"On October 18, U.S. Border Patrol conducted a targeted immigration enforcement operation that resulted in the arrest of Ruben Torres Maldanado, a criminal illegal alien from Mexico.
"His criminal history shows he has a history of habitual driving offenses and has been charged multiple times with driving without insurance, driving without a valid license, and speeding.
"During his arrest he did not comply with instructions from the officers and attempted to flee in his vehicle and backed into a government vehicle. He will remain in ICE custody pending removal.
"This is nothing more than a desperate Hail Mary attempt to keep a criminal illegal alien in our country. The Trump administration is fighting for the rule of law and the American people."