The Mexico City Grand Prix will remain on the F1 calendar until 2028 as part of a new three-year extension.