PHOENIX  Here in Arizona, illegal immigrants get the boot. But refugees get the welcome mat.

Even as officials rage at what they have called the “invasion” of illegal immigrants, mostly Mexicans, Arizona has welcomed thousands of legal immigrants from such grief-torn lands as Somalia, Myanmar and Iraq, and is known for treating them unusually well.

Indeed, the scorched expanse of the Phoenix valley can seem like a giant resettlement lab. Bosnians trim the watered lawns of the Arizona Biltmore, and Karenni speakers have their own prenatal class at St. Joseph’s hospital. A Sudanese goat farmer is thriving in a desert slaughterhouse built with a micro-enterprise loan. (He is glad to demonstrate his skill in turning goats to goat meat.)

Hai Doo, a laundry worker from Myanmar, got grants to buy his first home. Yasoda Bhattarai, a new mother from Bhutan, credits 10 weeks of free hospital care for saving her daughter, who was born with tuberculosis. “Whenever people ask me about Phoenix, I tell them it is the best place,” she said.

Only three states accepted more refugees on a per capita basis over the past six years. Arizona took nearly twice as many refugees per capita as its liberal neighbor, California, and more than twice as many per capita as New York, New Jersey and Connecticut.