Conformal geodesics are solutions to a system of third order of equations, which makes a Lagrangian formulation problematic. We show how enlarging the class of allowed variations leads to a variational formulation for this system with a third--order conformally invariant Lagrangian. We also discuss the conformally invariant system of fourth order ODEs arising from this Lagrangian, and show that some of its integral curves are spirals.