Connected and autonomous vehicles (CAVs), unlike conventional cars, will utilise the whole space of intersections and cross in a lane-free order. This paper formulates such a lanefree crossing of intersections as a multi-objective optimal control problem (OCP) that minimises the overall crossing time, as well as the energy consumption due to the acceleration of CAVs. The constraints that avoid collision of vehicles with each other and with road boundaries are smoothed by applying the dual problem theory of convex optimisation. The developed algorithm is capable of finding the lower boundary of the crossing time of a junction which can be used as a benchmark for comparing other intersection crossing algorithms. Simulation results show that the lane-free crossing time is better by an average of 40% as compared to the state-of-the-art reservation-based method, whilst consuming the same amount of energy. Furthermore, it is shown that the lane-free crossing time through intersections is fixed to a constant value regardless of the number of CAVs.