Barcelona said Tuesday the deal will be signed "in the coming days."
Barcelona is enjoying perhaps the most successful spell in its 112-year history under Guardiola, who took over from Frank Rijkaard in 2008.
Guardiola had said he preferred to sign one-year extensions over a long-term deal to maintain his motivation.
Since Guardiola took over, Barcelona has won eight major trophies including two straight Spanish league titles, the Champions League, the European Super Cup and a Club World Cup.
It has won a Spanish record 16 straight league games and has a seven-point lead over Real Madrid.