SEATTLE — A federal magistrate on Friday declined to immediately release a man arrested by immigration agents last week despite his participation in a federal program to protect those brought to the U.S. illegally.

Magistrate Judge James P. Donohue said in U.S. District Court in Seattle that Daniel Ramirez Medina must request a bond hearing from a federal immigration judge and that the hearing should take place within a week.

While Donohue deferred to the immigration judge on the custody issue, he said the case would return to his court on the issue of whether the federal court has jurisdiction to hear Ramirez's claims that his detention violated his rights.

The judge also said he recognized the unusual nature of the case and noted that there are others in similar situations to Ramirez who want answers.

The U.S. Justice Department argued that there was "no legal basis for a district court to consider any challenge" to the detention of Ramirez, 23, in part because his case is pending in immigration court.

"We're hopeful the immigration judge will recognize there's no reason to keep Mr. Ramirez," Theodore Boutrous, one of his attorneys said outside the courthouse after Friday's hearing.

Ramirez is being held at a federal detention center in Tacoma and did not appear in the courtroom.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

Related: Lawmakers Meet With ICE, Warn All Undocumented Immigrants at Risk

Ramirez's attorneys said the bond hearing will only deal with the question of Ramirez's immediate release. They said they eventually want to get the court to develop standards to protect others under the Deferred Action for Childhood Arrivals (DACA) program.

"This case is about more than Mr. Ramirez. We want to get him out of detention and protect his rights. But this could affect hundreds of thousands of people, and the judge recognized today that this case is important beyond this case," he added.

The father of three was arrested last week, thrusting him into a national debate over the immigration priorities of President Donald Trump.

Some saw the detention as the opening salvo in an attack on former President Barack Obama's DACA program, while federal authorities suggested it was simply a routine exercise of their authority.

Dozens of people demonstrated in his support outside the courthouse before and after Friday's hearing. Some held signs that said "Free Daniel," or "No Deportations: Not 1 More."

Seattle City Councilwoman Lorena Gonzalez, who attended the hearing, said afterward that she was disappointed but was glad for an expedited bond hearing. "The faster we can resolve this, the better for Daniel and his family and the 750,000 dreamers that are currently living in limbo across the country," she said.

"It worries me that our current president is creating worry in our community," said Antonio Amaya, who brought his two young children to the morning rally. "I brought my kids here because it's important to teach my kids that the struggle needs to continue."

But Ramirez attorney Mark Rosenbaum assured those benefiting from the DACA program that "there's no need to panic today."

"There's no reason to think this manner will not be resolved properly," he added. "We are frustrated that he (Ramirez) remains in detention for even a single hour more, but DACA is still the law, it's still on the books."

Related:

Related: Hispanic Caucus Says ICE Confirmed It Went 'Broader' on Immigration Arrests

Court documents filed by the government said Ramirez admitted to having gang ties when questioned by an immigration agent. His lawyers called the allegation false and said the federal government has failed to show proof of that statement.

The court documents also said Ramirez had a "gang tattoo" on his forearm, but Rosenbaum said the agents misidentified it. He said it reads "La Paz BCS." La Paz means "Peace" in Spanish and is also the capital of the Mexican state of Baja California Sur, where Ramirez was born, he said.

Ramirez is father of a 3-year-old son who is a U.S. citizen, his lawyers have said. He worked on farms picking fruit in California before moving to Washington, and he twice passed background checks to participate in the DACA program— most recently last spring, they said.

Immigration agents found him earlier this month when they went to an apartment complex in the Seattle suburb of Des Moines to arrest his father, identified as Antonio Ramirez-Polendo. Ramirez-Polendo was deported eight times between 2000 and 2006, U.S. Immigration and Customs Enforcement said Thursday, and he served a year in prison in Washington state for felony drug trafficking.