The Australian had originally been committed to McLaren until the end of 2024, having been lured away from an Alpine reserve role last year with the promise of a race seat.
But after a strong debut season as team-mate to Lando Norris, McLaren announced on Wednesday that the Australian would stay on board for at least an extra two years.
Speaking about his new deal, Piastri said: “I am thrilled to be extending my partnership with McLaren for many years. I want to be fighting it out at the front of the grid with this team and I am excited by the vision and foundations that are already being laid to get us there.
“The welcome that I have received and the relationships that I have built make this feel like home already.
“The team’s consistent commitment in me has made me feel incredibly valued and the desire from the team for me to be part of its long-term future made this an easy decision. To be wanted like that and for the team to show so much belief in me after just half a season, means a lot.”
Team principal Andrea Stella added: “It’s fantastic to confirm that Oscar has signed a multi-year extension with the team.
“Oscar is an asset to McLaren and constantly impresses with his performance, work ethic and attitude, so it was an easy decision for the team to make. He has already proved pivotal to the team, so it’s brilliant to have his vote of confidence as we push to win championships again in the future. I look forward to seeing him develop with us as we continue this journey together.”
Although Piastri has yet to secure a podium in a grand prix, he did finish second in the sprint race in Belgium this year.
Piastri’s contract extension means McLaren’s current drivers are now locked in for the foreseeable future.
Lando Norris has a contract that runs until the end of 2025, although McLaren will likely face a battle to keep hold of his services after then with a host of big teams – including Ferrari, Red Bull and Aston Martin – all having been linked with the Briton.