A subtle comedy with considerable pathos, “Beatriz at Dinner” made me laugh a bit and squirm a lot. That’s its aim as it focuses on a clash between the 1-percenters among Los Angeles’ Anglo society and the Mexican immigrant working class.

At one point, John Lithgow, playing a real estate billionaire, shows Salma Hayek, an idealistic Latina health practitioner, a photo on his phone of a rhino he shot in Africa. Because such upscale safaris help fund conservation programs, he declares, “I don’t consider it murder.”

“You think it’s funny? I think it’s sick,” she says, flinging the phone back at him like a club. Written by Mike White (in a tone very different from his sweetly charming “School of Rock”) and directed by Miguel Arteta (“Cedar Falls”), it carries powerful irony.

The setting is a gated community of McMansions where Hayek’s Beatriz, a New Age-y healer, does house-call massage for Cathy (Connie Britton). When Beatriz’s car dies, Cathy invites her to stay overnight as she awaits help. In fact, Cathy says, she should join the evening’s guests for a small dinner party celebrating a land deal that will make them all even richer.

Cathy respects Beatriz, whose empathy and care helped her daughter through a hard time in the hospital. She introduces her to the other women attending (played to catty perfection by Chloe Sevigny and Amy Landecker) as “my dearest friend.” Cathy means well, but the rest recognize privileged patronizing when they hear it. The performances are so genuine that it’s hard to watch.

The early scenes set up a restrained, play-it-straight comedy of manners. But in today’s world, there are controversy-triggered land mines on every social pathway. Lithgow, the wonderfully named Doug Strutt, sees the unfamiliar Latina in casual clothes and greets her with, “Can I have another bourbon, hon?” When he learns who she is, he pops the inevitable question, “Did you come legally?”

Through White’s script and Arteta’s smooth direction, most characters get a hard drubbing and a fair hearing. Doug has a grating “me first” attitude, but he’s also savvy enough to know how to play business games, and he’s somewhat curious about how the world looks to people far below his penthouse level. Is it wrong to be a little wary about a health worker who chose her career from the sympathy she felt for a mistreated octopus?

The film moves to a tone of Latin American magical realism as the end approaches, fantastic elements competing with objective truth. What begins as a wise comedy told from the perspective of an honorable immigrant becomes a harsh, strong and poetic account of a dark chapter in our national life.

MOVIE REVIEW

“Beatriz at Dinner”

Grade: B

Starring Salma Hayek, John Lithgow and Connie Britton. Directed by Miguel Arteta. In English and partly subtitled Spanish.

Rated R for language and a scene of violence. Check listings for theaters. 1 hours, 23 minutes.

Bottom line: A subtle comedy that ends as a poetic account of a dark chapter