Clearly a labor of love for Rupert Everett, who wrote and directed as well as starring in it, “The Happy Prince” is unlike earlier films about Oscar Wilde in that it concentrates on the last years of his life, following his release from prison, rather than his earlier years of celebrity and the 1895 trial on charges of gross indecency that brought his downfall—and two years of heavy labor in prison. Everett offers captions upfront to cover those matters, and occasional flashbacks to them as well, but apart from those his screenplay focuses on the three years of disgrace and exile on the continent between 1897 and 1900, ending with his death in Paris.

Everett gives shape to an episodic treatment in a couple of ways. One is to make Wilde’s titular 1888 short story—about a statue that effectively destroys itself in order to alleviate human suffering (helped in the endeavor by a sparrow that gives up its life in the process)—a running theme, beginning with the author reciting it to his two sons before his conviction and then to Jean and Leon (Benjamin Voison and Matteo Salamone), street children whom he befriends in the French capital. Another is by recurring periodically to what Wilde remembers as the most humiliating experience of his ordeal—a stopover at Clapham Junction during his 1895 transfer from Wandsworth Prison to Reading Jail in 1895—during which he was ridiculed, even spat on, by onlookers.

The major chapters of the plot are determined by the various places on the continent Wilde resides in during his final years. The first is Dieppe, the French coastal town where he is met by his friends, his agent Robbie Ross (Edwin Thomas) and novelist Reggie Turner (Colin Firth) and put up in a hotel under the alias Sebastian Melmoth. There he will be feted by a crowd of young poets and badgered by some vacationing British schoolboys before being forced to leave when his identity is revealed.

But the great drama of his stay is internal. He claims a desire to reconcile with his crippled wife Constance (Emily Watson) and their sons. But despite his initial condemnation of his erstwhile lover Alfred Douglas, affectionately known as Bosie (Colin Morgan), Wilde cannot overcome his obsession with the “dear boy,” and when Douglas arrives on the continent, he cajoles Oscar to go off with him to Naples, where they exhaust their meager resources in a life of hedonism with the locals, including handsome waiter Felice (Antonio Spagnuolo).

The relationship is as fraught as ever, however, and Bosie departs for home; Wilde moves on to Paris, where his funds run dry and he lives in penurious squalor, which even Ross and Turner cannot rescue him from. His dalliances with Jean, fueled by absinthe and cocaine when he can afford them, and his affection for young Leon cannot halt his physical and mental disintegration, and inevitably the film reaches his deathbed, portrayed in poignant tones as he comes to terms with his past as his boys—his real sons, via hallucinations, and his surrogate ones, in person—as well as his best friends look on. To lighten the mood, Tom Wilkinson (who played Wilde’s nemesis and Bosie’s father, the Marquis of Queensbury, in Brian Gilbert’s 1998 biopic starring Stephen Fry) is introduced as Father Dunne, the priest called upon to offer the sacrament of unction prior to his demise; Wilkinson has a fine time in what amounts to a cameo as a clergyman who’s at once personally voluble and serious in his office. The funeral follows, with Bosie—who has treated Oscar contemptuously during a previous Paris visit—showing up to make a scene.

“The Happy Prince” is not just a personal statement by Everett, himself a gay man who ends his film with a caption noting Wilde’s pardon, along with others convicted of similar “crimes,” in 2017, but a tour de force for him as an actor. His Wilde is rueful, conflicted, desperate and ultimately hopeless, and while traversing the gamut of emotions he also demonstrates the wit that made him such a remarkable writer and raconteur. As screenwriter Everett has contrived for himself a raft of good lines, as well as a few flamboyant turns (like a song in a seedy bar), and he obviously relishes delivering them; but he also fills the role with poignancy. It’s a part Everett also seemed destined to play, and he fulfills every expectation one might have had of him doing so. Of course, he also added some speculation to the record of Wilde’s last years, but nothing in the film comes across as implausible, and certainly the dramatic impact is palpable.

Everett has chosen the rest of the cast with care, and all give committed performances, though some of the most distinguished names—Firth and Watson in particular—could have used greater opportunity to fill their characters. Wilkinson makes a major impression with his rather showy cameo, and so do Franca Abategiovanni, as Felice’s hot-tempered mother, and Morgan. He does an extravagantly over-the-top turn as Douglas, whose grotesque sense of aristocratic entitlement makes him a cad it’s impossible not to detest—which, of course, makes Wilde’s inability to break with him all the more baffling, self-destructive and sad.

For a film that must have been made on a fairly limited budget, “The Happy Prince” is beautifully mounted. The locations are lovely; Brian Morris’ production design, along with the costumes by Maurizio Millenotti and Gianni Casalnuovo, are exquisitely detailed; cinematographer John Conroy presents it all in lush, luminous widescreen images; and Nicolas Gaster’s editing integrates the flashbacks nicely into the basic narrative. Gabriel Yared’s sensitive score adds to the effect.

Previous biopics with Peter Finch, Robert Morley and Fry have told the tale of Oscar Wilde’s ignominious fall from grace with varying degrees of success. Now Everett’s finely tuned film provides a deeply felt coda to a story that has become ever more relevant over the course of the hundred-plus years since it happened.