Luigi Di Maio began his leadership of the Five Star Movement (M5S) over two years ago, promising to bring a measured, reassuring style to the anti-establishment party riding a wave of popularity.
But in stepping down on Wednesday, the party's former wonder boy ends his stewardship at a difficult moment, as the movement struggles to stay relevant amid infighting and a stream of departures by lawmakers in recent months.
Di Maio, 33, is expected to retain his post as foreign minister in the coalition government between the M5S and the centre-left Democratic Party (PD).
Before being named to foreign minister - Italy's youngest ever - Di Maio served in the last government as deputy prime minister, sharing power with the Matteo Salvini of the far-right League in an awkward alliance.
Di Maio's election as party leader in 2017 represented an important shift for the M5S -- from the frantic conspiratorial ranting of iconoclast founder and stand-up comedian Beppe Grillo to a less confrontational style.
But the young Neapolitan's willingness to jump into bed with both the League and later the PD -- whom the movement had spent years ferociously criticising -- caused critics to accuse him of putting power before policies.
"They've accused me of being too naive," Di Maio said during his goodbye speech. "But I'd rather be seen as that than as a swindler."
-- Youngest ever deputy speaker --
Di Maio has been involved with the M5S since its creation in 2009, campaigning against corruption and the European Union while promoting political transparency and direct democracy.
Following the February 2013 election, the movement won a spectacular quarter of the vote and Di Maio, then aged just 26, was among 108 M5S candidates elected to the Chamber of Deputies -- the lower house of the Italian parliament.
A month later he became the chamber's youngest ever deputy speaker.
But as head of M5S, Di Maio found himself repeatedly upstaged by Salvini, whose Italians-first message and fierce social media skills helped him quickly outstrip his younger political rival in popularity.
The party's deal with the PD was viewed cynically by many voters, who saw it as a bid to avoid a potentially disastrous election, and many M5S lawmakers have since quit the party.
Di Maio was born on July 6, 1986 into a well-to-do family in Avellino near Naples.
His father Antonio had a small construction business and was an activist for the now-defunct neo-fascist party Italian Social Movement, while his mother Paola was a Latin teacher.
The eldest of three children, Di Maio studied computer engineering at Naples University, but later switched to law and never completed his degree.
According to a CV posted on M5S's website, he founded his own web and social media marketing business while studying, as well as working on video projects.
A focus on marketing and presentation helped the M5S shift its tone on key issues with Di Maio at the helm.