A dramatic end to the race saw Charles Leclerc overtake Sergio Perez, but then the Mexican and Sebastian Vettel came through after Leclerc ran wide.