Arizona Gov. Jan Brewer signed into law Friday the most restrictive immigration bill in the country, setting the stage for a showdown with the Obama administration and reigniting an explosive national debate less than seven months before congressional midterm elections. Brewer, a Republican facing a stiff primary challenge, said Washington's failure to address the issue had effectively left border protection to the states, forcing her hand. 'We in Arizona have been more than patient waiting for Washington act,' she said, her remarks carried live on CNN as hundreds of demonstrators gathered outside her Phoenix office. 'But decades of federal inaction and misguided policy have created an unacceptable situation.' Even before it was signed, President Barack Obama criticized the Arizona law, which requires police to question anyone who appears to be in the country illegally. Obama called the effort 'misguided' and directed the Justice Department to monitor its implementation, warning that it could violate citizens' civil rights. Obama cited the measure as a sign that Congress must act swiftly on overhauling immigration, the subject of bipartisan talks that have stalled recently. 'Failure to act responsibly at the federal level will only open the door to irresponsibility by others,' he said. With the stroke of a pen, Brewer unleashed the passions of activists and politicians on both sides of the issue. Hispanics across the country, who form a key political bloc, threatened an energetic push to elect Democrats in November. House Speaker Nancy Pelosi, D-Calif., an advocate of immigration reform, issued a statement describing the law as 'harsh.' The response among national Republicans was more muted, reflecting a split over whether to pursue stricter immigration laws or to court the expanding pool of immigrant voters. Under the new law, to take effect in 90 days, it will be a state crime to be in the country illegally, and legal migrants must carry at all times paperwork proving their legal status. Arizona police will generally be required to question anyone they 'reasonably suspect' of being undocumented _ a vaguely defined and legally untested provision that critics argue will lead to racial profiling, but that supporters insist will give authorities the flexibility to enforce existing immigration laws. Obama, appearing in the Rose Garden, voiced opposition for the first time to the bill hours before it became law. Speaking at a naturalization ceremony for two dozen foreign-born members of the U.S. military, he urged the country to 'choose a different future' than the one advanced in Arizona. Although he said the Justice Department would 'closely monitor' developments, Obama stopped short of demanding immediate intervention. Swift legal challenges are expected from outside groups. Joining Obama at the Rose Garden event was Homeland Security Secretary Janet Napolitano, who, during two terms as Arizona's Democratic governor, vetoed similar bills repeatedly. She said she did so because 'they would have diverted critical law enforcement resources from the most serious threats to public safety.' Events on Friday underscored Arizona's role as a roiling cauldron of immigration politics: Brewer replaced Napolitano and is now running for a full term. State Treasurer Dean Martin, who is considered Brewer's biggest threat in the Aug. 24 Republican primary, had urged her to sign the bill. Sen. John McCain, in his own tough Republican primary for re-election, only recently came out in support of the bill _ and, on Friday, did not issue a statement. Senate Majority Leader Harry Reid, D-Nev., having concluded that talks to advance a bipartisan bill were stalled, has told Sens. Charles Schumer, D-N.Y., and Lindsey Graham, R-S.C., that if they cannot strike a deal within three weeks, Democrats will bring their own bill forward, aides and lobbyists said. Many lawmakers on both sides, familiar with how treacherous immigration reform proved when President George W. Bush sought it and failed, say they are uncertain about its prospects. Some Democrats have calculated that even if an immigration bill fails, a debate on it could rally their base and mobilize Hispanic voters against GOP lawmakers in some districts. The Arizona bill has also provided Democrats the opportunity to put Republicans on the defensive nationally. The legislation makes Arizona the first state to criminalize illegal immigration by defining unlawful presence as trespassing, according to the National Council of State Legislatures. Between 2007 and 2009, California, Colorado and Texas considered similar proposals but killed them. However, frustration in the states continues to drive legislatures to pass a patchwork of laws each year, some cracking down on illegal immigrants and others seeking to prevent exploitation of them by human traffickers and unscrupulous employers. NCSL estimates that about 1,400 bills are introduced each year. 'There's a huge concern, and states have been down this path before, where they have been taken to court and that has been very costly. ... This will be very much a wait-and-see approach,' said Ann Morse, director of the NSCL immigration policy project. Staff writers Jerry Markon, Marty Weil, Chris Cillizza and Ben Pershing contributed to this report. 