Barcelona's title challenge looked to be over when they lost to Cadiz back in December
On 5 December, Barcelona trudged disconsolately off the field at top-flight newcomers Cadiz after an embarrassing defeat which left them 12 points behind league leaders Atletico Madrid, having gained just four wins from their opening 10 games.
It was Barca's worst start to the season in 32 years, new manager Ronald Koeman was already under heavy pressure and the idea that they could mount a serious title challenge looked laughable.
Since then, however, the Catalan club have enjoyed a sudden, unexpected and hugely impressive resurgence.
They have won 16 of their last 19 league games, drawing the other three, and are now just one point behind flailing Atletico heading into Saturday's Clasico trip to Real Madrid, who are also firmly in the title hunt, just two points further back.
So how did Barca's transformation transpire?
Barcelona's revival this season
Wins Draws Losses Points
First 10 league games 4 2 4 14
Last 19 league games 16 3 0 51
The exuberance of youth
Barca's renaissance has been built upon a renewal of energy and intensity courtesy of an exciting batch of young players, whose performances during their first campaign at senior level have far exceeded any reasonable expectations.
The jewel in the crown is Pedri, a physically slender but technically gifted playmaking midfielder who arrived from second tier Las Palmas for an initial fee of just €5m (£4.3m) last summer.
Pedri was viewed as the proverbial 'one for the future' when he signed, but his clever movement, smooth control and outstanding passing have seen him quickly become one of the first names on Koeman's teamsheet.
Pedri, right, has started 34 games for Barcelona this season
Despite only being 18-years-old, Pedri has already made 46 appearances this season - including three during the recent international break for Spain, with whom he is set to star in this summer's Euros.
And Pedri is not the only one: right-back Sergino Dest (20 years old, 33 appearances), central defenders Oscar Mingueza (21 years, 31 apps) and Ronald Araujo (22 years, 24 apps), winger Trincao (21 years, 37 apps), playmaker Riqui Puig (21 years, 21 apps) and midfielder Ilaix Moriba (18 years, 9 apps) have all been important - and that's even without arguably Barca's best young player, currently injured teen forward Ansu Fati.
After years of stagnation, Barca's famed ability to develop youthful talent is once again coming to the fore.
Veterans revitalised… including Messi Lionel Messi has scored 23 goals in 27 league games this season
The influence of those rising stars has acted like a massive shot of adrenaline into the limbs of a jaded squad.
Whereas Barca regularly looked tired, slow and old over the last couple of years, now there is an unmistakeable freshness and vitality to the team - with the happy knock-on effect of breathing new life into the established veterans.
Sergio Busquets and Jordi Alba, in particular, are playing their best football for years, completely turning around the notion that they had entered into an irreversible decline.
And then, of course, there is Lionel Messi.
The iconic captain made a slow start to the season, hardly surprising in the wake of a turbulent summer which saw him launch a failed attempt to leave the club before being forced to stay against his will.
Messi only registered eight goals (including six penalties) and two assists during his first 18 appearances in all competitions this season, with his largely subdued displays mirroring the team's wider struggles at that time.
But now his situation has totally changed. With the team looking competitive, Messi is enjoying his football again. Smiles have displaced scowls, the pleasure he derives from playing alongside Pedri is plain to see, and his performances have been accordingly transformed.
Messi has recorded 19 goals and eight assists in his last 20 games, and his mood has been further improved by the re-election of his old ally Joan Laporta as club president.
Just a few weeks ago, it looked inevitable that Messi would walk away from the club at the end of the season. Now, it seems much more likely that he is ready to lead a new generation of talent towards a bright future.
Koeman's tactical triumphs Ronald Koeman has found a formation and system that is now getting the best out of Barcelona's talented youth and experienced older heads
A lot of credit must also go to Koeman who - after some initial misfires - has found the right way to blend together his exuberant youngsters and savvy veterans into a well-functioning collective.
The turning point came in a 2-0 win at Sevilla in February, when Koeman lined up with a three-man central defensive unit and Ousmane Dembele playing through the middle as a striker behind Messi.
The outcome was a convincing team performance and - after an opener from the rejuvenated Dembele - a comfortable victory which, perhaps for the first time, confirmed Barca as a serious title contender.
That win at Sevilla also saw Koeman's men reverse their long-established trend of struggling in big games on the road. They have now won nine consecutive away league games since the December debacle in Cadiz, just one short of the all-time club record which they will aim to equal this weekend in Madrid.
The 3-4-3 or 3-5-2 formation (depending on whether Koeman selects Antoine Griezmann in attack alongside Messi and Dembele or prefers to bolster the midfield) has given Barca a more compact shape, making them more effective without the ball and generally much harder to play against.
But Koeman is not wedded to the new shape, which he abandoned at half-time during last weekend's narrow 1-0 win over Real Valladolid - eventually earned through a late goal from Dembele - by reverting to a back four.
The key figure tactically is Koeman's compatriot Frenkie de Jong, who has been remodelled into a ball-playing central defender over recent weeks but may be restored to his old position in midfield once Gerard Pique returns to fitness.
Whichever tactical direction he takes from here, Koeman's successes in the last few weeks have earned him a significant amount of trust to lead the team on a title challenge which looked impossible - even by his own admission - just a few weeks ago.
And now for the Dutchman's next challenge: gaining his first Clasico victory as a coach.
Deeply Human: Why are we the exception to the norm when it comes to sex?
Wind in the Willows: Six life lessons the four-legged friends could teach us