The Five Star Movement (M5S) formed the Eurosceptic EFDD Group when it first elected its members in the European Parliament (EP) in 2014. Two and a half years later, the M5S sought, without success, to leave the Eurosceptics and join the Liberal group. This attempted change of transnational affiliation is puzzling: why has the M5S tried to leave the Eurosceptic group to ally with the most Europhile group in the EP? How could this U-turn be explained? Relying on several different data -the EUANDI party dataset, official EP data, and original interviews with members of the EP -this article provides a systematic answer to these questions. We test three general hypotheses on group membership in the EP, using the M5S as a case-study. We show that neither policy congruence nor the pursuit of office fully explain the M5S's observed or attempted alliances. We suggest, instead, that 'domestic politics' is the key driver of the M5S's behaviour in the EP. Political group membership is functional to the Movement's strategic objectives at home. This article shows that national-level explanations of transnational affiliation need to be given more consideration, and highlights the 'second order' importance of the EU arena with respect to 'first order' national strategic objectives.