It’s been a while since we’ve received a memorable western. It’s been a very long time since one was as unforgettable as “Unforgiven” or “True Grit.” And a film that is at once an 1850s feminist epic, a morbidly amusing prairie farce and a revisionist action-adventure yarn is pretty much unheard of.

That’s exactly what Tommy Lee Jones gives us in “The Homesman,” the spiky and relevant pioneer fable he directed and co-wrote. He also co-stars with Hilary Swank and a cast including John Lithgow, Meryl Streep, James Spader, Tim Blake Nelson and William Fichtner, which is how you define “all-star.”

“The Homesman” is strangely beautiful, beautifully strange and stunningly surprising, with rare gunfire and a single shot of Indians. It presents Swank doing well in the role of Mary Bee Cuddy, a thoughtful, capable Nebraska Territory farm owner who embodies a spirit of independent American womanhood at a difficult time.

An upstate New Yorker by birth, she can control a plow, run her spread’s finances and deal with any morally demanding situation among her neighbors. The local preacher praises Mary Bee as being a better “man” than most of the downtrodden community’s males. She may well be the film’s title character.

She is also a rather unglamorous spinster, dejected because she cannot find a beau whereby she can start a family. She invites her nearest neighbor to a proposal dinner, explaining how their union would surely join their properties and chattels to their joint benefit. Full of fried chicken and pie, he bluntly declines: “You’re too bossy and you’re too damn plain.”

Still, no one denies she is hardworking. Three women in the area have lost their minds to such dreadful frontier burdens as freezing winter nights and dying infants. They must be transported by cart through Missouri to an asylum in Iowa. None of their menfolk will accompany them. The preacher, handling the apparent eruption of lunacy, drafts devout Mary Bee to lead the rescue effort.

Jones plays a shiftless, ornery old claim jumper first seen in his long johns after a dynamite blast chases him from a homestead he tried to seize. He agrees to be Mary Bee’s aide on the cross-country journey. He joins in part because she rescues him from a lynch mob, an occasion that spoils his feelings considerably. Getting her to afford him a jug of whiskey and a bank payment is a bigger motive. He is as cynical as she is direct. When she asks his name he replies, after a pause that implies considering alternatives, “Let’s say George.” “George what?” she continues. Another recess brings, “Briggs.”

The film’s main focus is the mismatched pair on their five-week passage east. Mary Bee tries to draw the truculent George into conversation. Not much interested in femininity, the bad man treats her as if she were as insane as their wards. Yet the movie contains something like an outlandish love affair as he slowly begins to offer Miss Cuddy and the ill trio doses of hushed, humane care.

Does it end well? A genre film might favor a conventional finale, but this story avoids typical fare. Nightmarish hallucinations and riotous humor hit more often.

Spader plays a silver-tongued Irish hotel builder who envisions women as servants or models for entryway nude paintings; Nelson is a distasteful drifter who sees them as trashy skanks at best. Both characters arrive uproariously and depart otherwise.

The film has more surprising turns than a honeycomb has bees. Absurdity and calamity collide without warning. The story delights, from its charming lead performances to the remarkably fine climax. They say a comedy ends with a marriage and a tragedy ends with a funeral. “The Homesman” ends, correctly, with a drunken jig and gunfire.