The Budapest venue already had paperwork in place to run the race until 2027 but that deal has now been extended.
A new pit building and main grandstand, which have been in the works since 2015, are expected to be completed in time for the 2026 event.
As per the last two years, the Hungarian GP will run as the penultimate race before the summer break in 2024. It has a 19-21 July slot.
F1 president and CEO Stefano Domenicali said: “It is great news to announce the extension of the Hungarian Grand Prix for an additional five years as we return for another action-packed weekend at the Hungaroring.
“It is a very special circuit next to the incredible city of Budapest and one all of the drivers and our fans look forward to on the calendar.
“To see the commitment from the promoter in Hungary to develop the facilities and further enhance the experience for fans is another important step and something we want to see all our events doing in order to continue to improve and make our races even better.”
The Hungaroring has featured on the F1 calendar since 1986 and 300,000 fans are expected to attend the GP this weekend, marking a 10,000 increase on last season.
Zsolt Gyulay, CEO and President of the Hungaroring, added: “We are proud and honoured to have agreed this contract extension.
“Given the astonishing rise in F1’s global popularity, which now sees more venues than ever before competing to join the calendar, today’s signing marks a hugely significant achievement for us.
“Fittingly, the updates to our famous circuit - which include renovations to our Main Paddock Building, Main Grandstand and Spectator Zones - are expected to be completed by 2026.
“It will be a source of great satisfaction to host the teams and fans, who will always be our main priority, at a world-class venue that will reflect the high standards you come to expect for an F1 race weekend.
“My colleagues and I began work on this significant development project eight years ago and today’s announcement acts as the crowning accomplishment for our collective efforts.
“I would therefore like to thank everyone involved in getting us to this point today and look forward to many more years of premium F1 racing at the Hungaroring.”