The judge also blocked provisions of the law making it a crime for failing to apply for or carry alien registration papers or "for an unauthorized alien to solicit, apply for, or perform work," and a provision "authorizing the warrantless arrest of a person" if there is reason to believe that person might be subject to deportation.
The remaining parts of the SB 1070 will go into effect at 12:01 a.m. Thursday.
For instance, a ban on so-called sanctuary cities stands, as does making it a crime to pick up day laborers who are illegal immigrants. The parts of the law dealing with sanctions for the hiring of illegal immigrants also goes into effect Thursday.
Gov. Brewer signed the law in April, sparking a nationwide debate on illegal immigration. After fears it would lead to racial profiling, lawmakers made changes that outlaw targeting someone because of his or her race or nationality.
The law inspired similar legislation in other states, prompted a boycott against Arizona and led to legal and illegal immigrants leaving the state. Some college students decided not to attend Arizona schools for fear they'd be pulled over or arrested.
Several civil rights groups filed lawsuits against Arizona. The Department of Justice challenged the law on the grounds that policing immigration is the exclusive right of the federal government. DOJ lawyers argued the government couldn't have 50 states making their own immigration laws.
"While we understand the frustration of Arizonans with the broken immigration system, a patchwork of state and local policies would seriously disrupt federal immigration enforcement and would ultimately be counterproductive," the DOJ said in a statement after the ruling. "States can and do play a role in cooperating with the federal government in its enforcement of the immigration laws, but they must do so within our constitutional framework."
The White House had no immediate comment on the ruling, but President Obama has raised questions about its legality in the past.
Despite criticism it is not doing enough to crackdown on illegal immigration from Mexico, the federal government has deported a record number if illegal immigrants since Obama took office.
The Immigration and Customs Enforcement agency expects to deport about 400,000 people this year, nearly 10 percent above the Bush administration's 2008 total.
Gov. Brewer is running for another term in November and has seen her political fortunes rise because of the law's popularity among conservatives. It's not yet clear how the ruling will affect her campaign, but her opponent was quick to pounce.
"Jan Brewer played politics with immigration, and she lost," said Arizona Attorney General Terry Goddard, a Democrat. "It is time to look beyond election year grandstanding and begin to repair the damage to Arizona's image and economy."
Republican Rep. John Kavanagh, one of the law's top supporters, said he was disappointed by the ruling and that he expects it to ultimately end up being decided by the U.S. Supreme Court.
"I don't think the judge's statements in the hearings justify this ruling," Kavanagh said. "I don't think the law justified her injunction."
*CNN and The Associated Press contributed to this report