MAYWOOD AND COSTA MESA, CALIF.
— One community is car-horn noisy, smokestack gritty, and tightly packed - with narrow streets, tiny houses, and flowering window boxes. The other is golf-course quiet, sumptuously green, and suburban - with broad boulevards, spacious lawns, and parks.

Just a few miles of freeway separate these southern California towns, but they are light-years apart in their responses to America's immigration debate. Maywood, population 45,000 and 96 percent Latino, is a self- proclaimed "sanctuary" for illegal immigrants. Costa Mesa, population 110,000 and one-third Latino, is examining ways to train some of its police force to help US immigration officials identify illegals.

As Washington grapples with rewriting US immigration law, possibly settling the status of up to 12 million undocumented residents, the state that is home to 1 in 3 of them shows how the issue is playing out at the local level - with communities deciding for themselves whether to support or subvert the federal will.

"Though immigration policy is primarily a federal prerogative, there is incredible variation at the local and state level playing out now," says Karthick Ramakrishnan, a political scientist at the University of California at Riverside and author of "Democracy in Immigrant America." "The big story at the local level now is that smaller towns, from 50,000 to 100,000 residents, are wading into the problem. Even though California has been dealing with this for decades, its smaller cities are just beginning to wrestle [with] the challenges."

Overlapping local, state, and federal mandates may be contributing to conflict and confusion among jurisdictions, say Professor Ramakrishnan and others. The federal government has primary responsibility for border enforcement and deportation, while local governments are responsible for maintaining law and order and providing public services.

In January, Maywood became the first municipality in California to declare itself a "sanctuary city." The city council, in effect, signalled its displeasure with legislation that had recently cleared the US House, voting to disregard the bill's call to classify illegal presence in the US as a felony and to enlist local police in enforcing federal immigration law. It also directed the city's police department to stop towing away cars of drivers who don't have driver's licenses - a practice it said unfairly targeted illegal immigrants.

"We did it because people in the community came to us and said we have to take a stand," says Deputy Mayor Felipe Aguirre, who runs a small Mexican art gallery on traffic-clogged Slauson Avenue. All last year, he says, residents became increasingly agitated about the Minutemen - groups of citizens, sometimes armed - standing watch at the US border to alert officials to illegal border-crossings. Then, in December, the House passed its tough border-security bill.

"The world around us is caught up in draconian ideas to tighten the noose around people who are taking care of their kids, landscaping their homes, making their clothes, picking their food," says Mr. Aguirre. "We believe there is a higher law."

A few freeway exits to the south in Costa Mesa, 24-hour fitness gyms, yoga centers, and franchise food outlets stand in contrast to Maywood's retail strips. Here, a different attitude toward illegal immigration finds expression.

"I just feel that immigration is out of control, and no one is standing up to say enough is enough," says Clara Forsythe, a college senior, sipping a latte outside the Starbucks on West 19th Street. She has felt the impact of increased street crime - including car theft and home burglary in recent years - and attributes rising problems at local schools to immigrants who don't know or won't learn English.

In the same way that Aguirre and other Maywood residents say they feel "embattled" by threats of crackdowns on illegal immigrants, Ms. Forsythe says she feels that her way of life is being "encroached on." She was distressed by a huge street demonstration in Los Angeles late last month in favor of immigrant rights, saying those demonstrators in the country illegally "disregard US law but then drain social services, from hospitals to schools and prisons."

She supports a move by Costa Mesa's city council to ask federal Immigration and Customs Enforcement (ICE) officers to "cross-designate" Costa Mesa police personnel - the first municipality in the country to do so. Cross-designation is a kind of additional training for nonfederal agents - in this case a small subset of Costa Mesa police - that allows them to access previously restricted federal databases relative to immigration status. If a database shows a suspected illegal immigrant is a known felon, local officials hand the person over to ICE officials, who begin deportation proceedings.

In both Maywood and Costa Mesa, not all residents are pleased with their town's immigration decisions. Former Maywood Mayor Sam Pena, who remains a councillor, says the city should not be flouting federal law, but rather should work within the system to change it. In Costa Mesa, public outcry forced local officials to scale down their initial proposal to give cross-designation training to most patrol officers. Instead, they are asking for training for about 30 gang-enforcement specialists and plainclothes detectives who deal with violent felons.

On Saturday, hundreds of Latinos demonstrated at Costa Mesa City Hall to protest the measure, and local tempers are flaring.

"There has been lots of misinformation and disinformation about these proposals," says Sgt. Ron Smith of the Costa Mesa police department. "There is both lack of general understanding of what is going on, as well as people on both sides trying to misrepresent the other for their own agenda."

That lack of general understanding is exacerbated by at least two phenomena, say experts. One is a major finding of a 2005 Public Policy Institute of California study that "most immigrants in California lack much experience with the American political system ... immigrant involvement in city government may be quite limited."

The other is the clash between local law-and-order prerogatives and federal border-and-deportation mandates. When Congress debated in 2004 the so-called CLEAR Act (a law to let state and local agencies determine their own participation in enforcing federal immigration laws), the International Association of Chiefs of Police issued a statement saying such plans could have a "chilling effect" on the ability of local police to protect the public they serve.

The worry is that local police would see reports of criminal activity dry up in immigrant communities, as both legal and illegal immigrants come to avoid police contact.

"The role of local governments in immigration policy is likely to remain unclear," says Ramakrishnan of UC Riverside. "In some cities it might mean working hand in hand with federal immigration and border authorities, and in others it might mean looking the other way."