Carlos Sainz said he wanted to claim another victory with Ferrari before leaving for Williams next year and on Sunday he achieved that aim with a masterful triumph in the Mexico City Grand Prix.

It brought him a second win this year, his career fourth and Ferrari’s third win in Mexico and first since Alain Prost in 1990.

Sainz’s win was also the first by a Spanish-speaking driver at the Mexican event — and on a special day for him and his family.

“Everyone knew I wanted it, to get one more win for Ferrari, and to leave the team on a high — I really wanted it,” said Sainz, 30, who learned he will be replaced by seven-time champion Lewis Hamilton in January.

“I have had to keep my motivation high all this year and it has been in difficult circumstances,” he said. “So, this had to happen and here in Mexico, a Spanish-speaking country and in front of my family and all my best friends.

“I knew my mum was here and that meant I had to do something extra and this is just great.”

Sainz’s win was Ferrari’s second in two races after Charles Leclerc triumphed in the United States Grand Prix, proving the team are on the way up under new team boss Fred Vasseur with a competitive car.

For Sainz, it was a masterful victory that underscored his place in the hearts of the Ferrari team just as his career with them reaches its end.

The win lifted them ahead of Red Bull in the constructors’ championship in second place chasing leaders McLaren.

“He has been through such a difficult year since he learned he had to find a new team,” said his father, former world rally drivers’ champion Carlos Sainz senior. “We are all here to be with him and to give him support.”

Sainz himself said the support of fans in Mexico had been “incredible”.

“Honestly, I really wanted this one, I needed it for myself, I wanted to get it done,” he said. “I’ve been saying for a while I wanted one more win before leaving Ferrari and to do it here in front of this mega crowd is incredible.

“Now, four races left and I want to enjoy it as much as possible and if another one comes I will go for it!”