© 2022 Elsevier LtdThis study considers an airport gate assignment problem where a set of aircraft arriving to an airport are assigned to the fixed gates of the airport terminal or to the apron. The aim is to lexicographically minimize the number of aircraft assigned to the apron, and then the total walking distance by passengers. A new mixed integer linear programming formulation and a matheuristic is proposed for the problem. The proposed formulation is based on the idea of flow of passengers and has smaller size compared to the existing formulations in the literature. The proposed matheuristic, which relies on solving a restricted version of the proposed formulation of the problem, is not only easy to implement but is also very effective. A computational study performed on benchmark instances reveals that the proposed formulation and the matheuristic outperform the existing exact and heuristic algorithms in the literature.