It was a huge challenge for composer Tim Minchin and director Matthew Warchus to follow the world-beating success of Matilda. Yet they have totally pulled it off. Their new musical Groundhog Day is a cast-iron triumph, both joyful and profound, incredibly funny and seriously moving.

Danny Rubin's book follows the lineaments of his 1993 film (directed by Harold Ramis and starring Bill Murray) but the production intelligently reimagines and remixes the ingredients for the stage. Its bravura confidence is there from the very start. We first meet cynical weatherman Phil Connors on film, on the multi-screens that adorn the front cloth. He's mucking around on camera, revealing his disenchantment at being told he has to travel to the small town of Punxsutawney, where the appearance of Groundhog Phil predicts the timing of the return of spring. "It had better be a big van," he snarls.

A tiny model van appears on the stage, making its way through the picturesque clutter of houses carried on and put in place by members of an all-singing ensemble in heavy weather gear. The magical transformation of the space in designer Rob Howell's set creates a tingle of anticipation that something special is in store. And then the first act is fluently up and running, as Phil moves through his first meeting with his producer Rita and the people of the town to a bouncy, Americana flecked tune.

His attitude is one of contempt for the homespun charm on offer. "There' s nothing more depressing than small town USA/ And small don't much smaller than Punxsutawney on Groundhog Day," he sings, as the chorus joins in. And then he sings it again, and again, as he realises he is trapped reliving the same day. Minchin's lyrics are a constantly surprising delight as the reality of Phil's plight dawns – he gleefully rhymes existentially with essentially. In one wonderfully funny number, Phil is seen consulting various quack doctors, in an attempt to escape. And the music, the switch between genres, the grumbling basses when he realises he is trapped, gives depth and texture.

The entire first act is effectively, a fugue and variations, kept moving in Warchus's deftly inspired direction and Peter Darling's free-form choreography, in a fluent, ever-changing frieze. There is – as in Harry Potter and the Cursed Child – a sense of pure pleasure in the mechanisms of theatre itself – the car chase where toy cars manipulated by hand seem to chase down an aerial view of streets, or a snowball fight where snow appears from nowhere.

But the brilliance of the structure lies in the way that the creative team have found infinite ways to create the film's equivalent of the jump cut, to move the story into different places and in unexpected ways, without ever losing its essential shape. The sheer aplomb of the telling is remarkable: the second act, instead of continuing Phil's story, opens with an affecting song for Nancy, a girl doomed to play pretty parts brooding on her lot. Then it switches to a contrasting sequence where Phil repeatedly attempts suicide – appearing, in swift sleight of hand, in two places at once.

The whole second act, in fact, mines the emotional and moral complexities of the story more deeply. There's a lovely moment for Ned Ryerson, butt of Phil's contempt, in which he reveals the tragic man behind the life insurance jokes. And the conclusion, when Phil comes to terms with all he has learnt – "I'm here, and I'm fine" – is a song of infinite resonance and feeling.

Minchin, whisper it quietly, might just be a genius. This is such an original and warm-hearted work. But it would be nothing without direction so seamless that even a full-blown tap number seems entirely fitting. And even less without the performances. As Rita, the object of Phil's desire, Carlyss Peer is gorgeously feisty and vulnerable at one and the same moment. And Broadway star Andy Karl is a revelation as Phil, finding infinite variations of grumpy misery that are eventually transmuted into a realisation of what life is about.

A good performer would have played the broad strokes; with impeccable timing and charismatic presence he plays the detail. It is an outstanding performance at the centre of a magnificent work that sends everyone out into the night cheering - and just a little wiser.

Groundhog Day runs at the Old Vic until 17 September.