Tommy Lee Jones’ “The Three Burials of Melquiades Estrada,” which he directed and co-produced from a script by Guillermo Arriaga as well as starring in as a crusty old cowboy, is a film of old-fashioned virtues centering on a rowdy but principled man who takes the law into his own hands to exact justice from a killer when the establishment tries to sweep the crime under the carpet because the victim–his unlikely close friend–was an illegal alien. Embodying the code of the West and an ideal of fair play that makes him a throwback in a society given to compromise and shady dealing, Jones’ grizzled but determined Pete Perkins is one of those icons of the range who–like the figures played by Kirk Douglas in “Lonely Are the Brave” or Clint Eastwood in “Unforgiven”–might seem either anachronistic or enfeebled (or both), but show that the old ways aren’t dead yet and that it’s still possible for right to win out.

But while the thrust of the picture is almost endearingly old-fashioned–not only in terms of its heroic protagonist and the streak of gruff, virile (and frequently gallows) humor that runs through it, which wouldn’t have been out of place in a John Ford western–it’s given a contemporary spin both in terms of its setting (today’s Texas-Mexican border) and villains (border guards and corrupt local cops), and by reasons of its organization, which is chronologically fractured and shuffled in the fashion that’s become Arriaga’s trademark (see “Amores Perros” and “21 Grams”). And, of course, its depiction of a friendship that crosses ethnic and national boundaries that might ordinarily have been barriers links it to older films while also touching on modern concerns.

The plot, in straightened-out form, centers on Perkins’ friendship with Melquiades Estrada (Julio Cesar Cedillo), a hardworking, rather reticent young man who settles in a Texas town near the Mexican border to raise sheep and do some seasonal wrangling work. When Estrada’s body is found half-buried in the desert, the border patrol and local sheriff Belmont (Dwight Yoakam) rebury his body–and the case involving his killing–with dispatch, much to the dismay of Pete, who’d pledged his friend that in the event of Estrada’s death, he’d return the corpse to his family to Mexico–and who’s determined to find out who shot his pal and balance the scales of justice. Involved in his quest are Belmont, who happens to be Pete’s rival for the affections of Rachel (Melissa Leo), a married waitress; Captain Gomez (Mel Rodriguez) of the border patrol; and Mike Norton (Barry Pepper), an aggressive patrolman who’s recently come to the area with his unhappy wife Lou Ann (January Jones). Eventually Perkins discovers the culprit, whom he kidnaps and drags on a difficult journey to return Estrada’s body to his family while pursued by the law. Of course there are twists and detours during the trip, which reveal both secrets and truths about character.

There are reminiscences throughout the picture to past films, not only “Brave” and “Unforgiven” but also “The Treasure of the Sierra Madre,” among others. But in this case the sense of familiarity is actually welcome. Jones pulls off his role with his usual flair, and though his direction emphasizes craft over imagination, it’s perfectly sound, and Chris Menges’ cinematography is similarly crisp and unfussy; Roberto Silvi’s editing is an equally important element in an effort that depends so heavily on keeping the shuffled plot threads clear. The rest of the cast is fine, with Pepper taking on a difficult part with a proper mixture of hatefulness and sympathy and Cedillo managing not to be insufferable as the quiet, recessive Estrada. (In the later stages of the movie, it must be said, he goes through even more than he did earlier.) Particularly strong in smaller roles are Levon Helm, who has a poignant cameo as an old blind man Perkins meets on the way to Mexico, and Yoakam, who shows a real penchant for nastiness–both real and comic–here. On the distaff side, Leo exudes a sense of world-weary cynicism but also warmth, while Jones tempers Lou Ann’s cheerleader mentality with a touch of pathos. But like most films of this sort, this is mostly a man’s movie.

It’s easy to overpraise a film like “The Three Burials of Melquiades Estrada.” It avoids taking hard dramatic choices, preferring easier resolutions and more uplifting climaxes than one might want. It’s satisfying without becoming truly challenging, a harsher version of a good telefilm. But like the best of John Sayles’ output, it’s a well-structured and literate yarn that employs the classic qualities of older films with a simplicity and sincerity that makes them fresh again, and the fact that it’s actually about people rather than visual effects makes it a refreshing change from the common run of Hollywood blockbusters. It may not be a great film, but it is a very good one.