Red Bull's Max Verstappen won the final race of the season in Abu Dhabi as Charles Leclerc beat the Dutchman's team-mates.
Leclerc, who was Verstappen's title rival earlier this year, held off Perez and took second place.
The four-time champion lamented when he felt that the strategy of his opponent was not good.
After Lewis Hamilton's Mercedes retired from fourth place with three laps to go, the last point was taken by Sebastian Vettel.
The race was tense because of the fight between Leclerc and Perez.
The same one-stop strategy was used by both Red Bull and Perez.
That left the Mexican to come back from a 23 second deficit in the final 24 laps if he was to beat Leclerc in a fight that would be decided on who finished ahead.
Perez closed at a second a lap and more for a while, but Leclerc measured his tyres with skill to secure second place in both race and championship, a result many will feel he deserves given he has had an inferior car to Perez for the majority of the year
Leclerc said over the radio that they had it. "Thank you, guys."
In a season in which he was 46 points ahead of Verstappen after just three races, it was small solace for Leclerc.
For the first time, Ferrari's strategy worked in Abu Dhabi.
They didn't want to pit straight after Perez had a delay at his first stop and then traffic when he came back, which would have given Leclerc a chance to take the place.
They ran Leclerc long to his first stop, allowing for a one-stop race and then taking it.
It wasn't easy for Leclerc, but he was still calm.
Hamilton bounced over the kerbs on the first lap as Carlos Sainz's car passed him at the chicane, which he cut and held the place.
After he was told to give it back, he lost his place on the team to George Russell.
Russell was given a five-second penalty for the pit stop delay and unsafe release.
Sainz and Russell were promoted to fourth and fifth after Hamilton lost steam in the closing stages.
There's more to come.