However, the company is seeing slumping sales at all of its major brands.
Robert J. Fisher, the company's non-executive chairman and a member of the Gap's founding family, will take over as interim CEO until a suitable replacement is found, the company said.
Peck, who has been at the company for almost 15 years and has served as CEO since 2015, will be replaced after a brief transition by interim chief executive Robert Fisher, a son of the Gap's founders and now the company's non-executive board chairman.
Earlier this year, Gap said it will separate its better-performing Old Navy brand and shutter about 230 stores of its namesake apparel business, a process likely to be completed by 2020. Gap said, comparable sales for the third quarter were down 4 percent versus flat last year and comparable sales at Gap Global were negative 7 percent versus negative 7 percent last year, at Banana Republic Global, negative 3 percent versus positive 2 percent last year, and at Old Navy Global, negative 4 percent versus positive 4 percent last year.
"As the board evaluates potential successors, our focus will be on strong leadership candidates with operational excellence to drive greater efficiency, speed and profitability", Fisher said in a statement.
The company's stock tumbled 7% to $16.75 in after-hours trading following the announcement. The retailer was in the midst of splitting into two publicly traded companies - one company would house its faster-growing Old Navy brand, while the second would oversee Gap, Banana Republic and its other brands such as Athleta.
The company expects adjusted earnings per share for the fiscal third quarter to be about 34 cents to 36 cents. Analysts had expected $2.06 per share for the year, according to FactSet.
Gap said it expects adjusted earnings per share between 50 and 52 cents for the third quarter.
In addition, the company's board appointed Bobby Martin, chair of its compensation and management development committee, as lead independent director.
The news was delivered in the company's quarterly earnings.