Back in 1969 George Roy Hill brought Paul Newman and Robert Redford together in Butch Cassidy and the Sundance Kid, a self-consciously stylish western in which two notorious bandits were celebrated as forerunners of the outlaw sensibility of the 1960s. A decade later, Richard Lester, one of the film-makers credited for shaping the artistic expression of the 60s with The Knack and two Beatles films, made his only western, Butch and Sundance: The Early Days. Featuring two young actors, Tom Berenger and William Katt, with uncanny resemblances to Newman and Redford, the film took a quirky but generally realistic look at frontier life as it related to the pair's early criminal life and friendship, ending in the 1890s at the point where they were becoming aware of being legends, leaders of a gang called the Wild Bunch. By this point Robert LeRoy Parker was styling himself Butch Cassidy and Harry Longabaugh was known as the Sundance Kid. The film was advertised as "a prequel", one of the earliest uses of this neologism, and in my 1979 review I rather pedantically objected to what I called "an etymologically meaningless term", suggesting it was unnecessary when prelude, prologue, preamble and prolegomena remained available.

Hill's film ended with the death of Butch and Sundance at the hands of the Bolivian police in 1908 after they'd been robbing banks in Latin America for the previous decade. The event was recorded with a shot of the pair defiantly brandishing guns, now as celebrated as the freeze-frame of Jean-Pierre Léaud on the beach that concludes Truffaut's Les Quatre cents coups. Such a finale should preclude a sequel. But long before the 1969 picture it was believed that Butch and Sundance might have survived the shootout in San Vicente and secretly returned to the States, just as some believe that Fletcher Christian, the leader of the mutiny on the Bounty, returned to England from Pitcairn Island. There is little hard evidence for this, but then there is no specific proof of their deaths, and in Blackthorn, Mateo Gil, the Spanish film-maker best known for his screenplays for Alejandro Amenábar, offers a fascinating imaginary sequel to the story of Butch and Sundance.

The setting is Bolivia in the 1920s, and Butch (Sam Shepard), now in his grizzled mid-60s, is on to his third name, living a simple, contented life as James Blackthorn with his devoted Indian peasant lover, Yana (Magaly Solier), in a beautiful, thinly populated mountainous region. He's a taciturn man, a successful horse breeder, but his settled existence is about to be disrupted and new moral and political challenges placed in his path. He takes a batch of horses to the distant nearest town and, having sold them, empties his bank account with the intention of giving money to Yana and returning to the States. But on his way back he helps a man whose horse has died in the wilderness. His kindness is repaid by being bushwhacked, and the stranger turns out to be a Spanish engineer, Eduardo Apocada (Eduardo Noriega). During a subsequent scuffle, Blackthorn/Cassidy's horse runs away with his money in the saddle bags, and the pair are left stranded.

The handsome engineer is apparently on his way to an abandoned mining town to recover a large sum of money he's hidden. The money belonged to a crooked capitalist who's sent a 14-man posse after him. So to recover his fortunes Blackthorn accompanies him first to the old mine and then on a painful journey across a giant salt flat and through snow-covered mountains, pursued first by the posse and then the Bolivian army. The beautiful, awesome landscape is superbly photographed by Juan Ruiz-Anchía, a Spanish cinematographer who has worked several times with David Mamet.

The engineer, however, is a devious charmer, treacherous and deceitful in ways that Blackthorn cannot understand. And along the way there are violent encounters, deprivations and puzzling moral decisions that contrast with the playful flashbacks to the time Blackthorn/Cassidy was travelling with the Sundance Kid and their shared lover, the beautiful Etta Place (Dominique McElligott). It's in the first of these flashbacks that we encounter Mackinley (Stephen Rea), a Pinkerton detective and stern upholder of the law who has come out of drunken local retirement to join in the pursuit of the newly notorious Butch. The outlaw and the lawman realise there's an ambiguous bond between them in this radically changed world. Butch gradually discovers that, like the gang in Peckinpah's The Wild Bunch, he's been lured into working with the wrong side in linking his fortunes to the engineer. His instinct for and trust in friendship has betrayed him. Gil's sinuous film is cleverly plotted, and it ends with a flashback and final freeze-frame of Butch, Sundance and Etta in their happy, earlier days in America.

Sam Shepard has for 30-odd years now been associated with the American west as a writer and actor, usually the modern west of motels, pickup trucks, rodeos and rundown cow towns as in his play Fool for Love, which Robert Altman filmed, and Paris, Texas. But he has also been involved in more traditional westerns such as the mysterious Silent Tongue, which he wrote and directed, and Andrew Dominik's masterly The Assassination of Jesse James. To Blackthorn, which is essentially a small-scale psychological film, he brings a whole body of work and personal experience. His version of the elderly Butch Cassidy, a man of a certain probity still attempting to make sense of himself, is among his finest, most nuanced performances. Watching this sombre, elegiac film I was reminded of Shepard's book Motel Chronicles, a beguiling collection of observations, jottings and poems he made while drifting around the west, and particularly of one endearing item dated "4/28/80, Santa Rosa, Ca":