Malawi coach Kinnah Phiri has signed a contract extension that will keep him in the job until 30th June 2014.
The government of Malawi announced the new deal on Tuesday but have not made public the exact terms of the new deal.
Earlier this year the Football Association of Malawi (Fam) agreed to recommend an extension for Phiri to government, who pay the coach's wages.
"We're happy the coach knows his job is secure so he can work whole heartedly," Fam CEO Suzgo Nyirenda said.
The government has also extended the contracts of assistant coach Young Chimodzi and technical director Jack Chamangwana by two years too.
Phiri qualified Malawi for the 2010 Africa Cup of Nations in Angola but the Flames crashed out at the group stage.
He threatened not to renew his contract due to the criticism aimed at him following the team's failure to qualify for the 2012 Nations Cup but is happy to continue as coach.
"I am very excited that the government of Malawi has entrusted in me and my backroom staff to continue with the Flames rebuilding exercise," he said.
"What I have now can be described as a developmental team because over the years we have been replacing fading players gradually and that takes time.
"I have trust in the young players that I have brought into the team and with time they will become stars," said Phiri.
The Malawi coach also said the timing of the new deal is good for The Flames ahead of their second leg game against Ghana in the Africa Cup of Nations on 13 October.
Malawi will need to win by three goals to have any chance of qualifying for next year's finals in South Africa having lost the first leg 2-0 in Accra.
"This has come as a big motivation to the technical team as we will work to prove a point against Ghana," he added.
"Anything can happen in football so if they won 2-0 in the first leg, what can stop us from scoring 3-0 here at home?".