The British restaurateur, known for shows including Hell's Kitchen and Ramsay's Kitchen Nightmares, will step into the driver's seat in 2028.
His co-presenters would be announced in due course, the BBC said.
The motoring program was "rested" in 2023 after Flintoff was seriously injured in a crash while filming at Dunsfold Aerodrome in Surrey in December 2022.
The former cricketer was driving a roofless Morgan Super 3 when the vehicle overturned and skidded along the tarmac.
Flintoff, who has spoken about suffering from post-traumatic stress disorder, was taken to hospital with facial and rib injuries.
He has previously said he did not think he had it in him to "get through" the ordeal and "wished I'd died".
He was part of the program's most recent presenting line-up, having made his Top Gear debut in 2019 alongside comedian Paddy McGuinness and motoring journalist Chris Harris.
Ramsay was among the stars speculated to take over the hit motoring program after the BBC announced earlier in 2026 that it would be returning.
Top Gear shared the news on social media, with a video of The Stig driving Ramsay around a racetrack as the TV chef exclaimed: "Woo! Yes! Top Gear is back!"
In a statement, Ramsay said: "My love affair with cars began as a child, growing up a field away from Silverstone, where I would climb over the fences and sneak in for a glimpse of the racing.
"That early excitement sparked a lifelong passion for cars, motor sport, beautiful design and extraordinary engineering.
"It's an incredibly exciting opportunity, and I genuinely can't wait to get started!"
Ramsay, 60, owns an extensive collection of cars that includes multiple Aston Martins and Ferraris, as well as a Porsche, Land Rover and McLaren Senna.
He has appeared as a guest on Top Gear several times, including in the first series of the reboot in 2002.
Filming will take place across the UK, including at the show's Dunsfold Aerodrome base, and around the world in 2027.
Other stars and motoring enthusiasts who were rumoured to be in the running to host the next series were comedian Jimmy Carr, actor Rowan Atkinson and model Jodie Kidd.
The original Top Gear ran from 1977 until 2001 and was revived in 2002.
Former Top Gear hosts include long-running regulars Jeremy Clarkson, James May and Richard Hammond.