The centre-back is a free agent after his contract with Arsenal was allowed to expire.
He had been hesitating over a return to Brazil, hoping to remain in Europe, but was unconvinced by the proposals he received.
The 34-year-old was linked with two Serie A clubs, newly-promoted Salernitana where he’d be a teammate to Franck Ribery and Lazio, with his former Chelsea boss Maurizio Sarri.
There was also interest from Benfica, Real Madrid and Turkish side Adana Demirspor.
However, David Luiz has seemingly made up his mind and will sign for Flamengo over the next 24 hours.
The new contract with the Rio de Janeiro club will run to December 2022.
He has 57 senior caps for Brazil, scoring three goals, and his previous clubs include Vitoria, Benfica, Chelsea and Paris Saint-Germain.
EXCL: David Luiz to Flamengo, verbal agreement reached and here we go! The Brazilian centre back has accepted the contract proposal until December 2022. He’s now set to join Mengão. 🔴⚫️ #Flamengo #transfers
Paperworks time now. Mission: winning the league also in Brazil. 🇧🇷 pic.twitter.com/O2W7q9H4IG
— Fabrizio Romano (@FabrizioRomano) September 10, 2021