Ghani made the statement on Wednesday night, in an address compatriots in their native language Pashto, during a live Facebook broadcast from the United Arab Emirates (UAE), reports Xinhua news agency.
He described the images coming out of Afghanistan as "gut-wrenching" but said: "I've learned the hard way that there was never a good time to withdraw US forces.
Ghani's last public appearance was on Wednesday in the northern city of Mazar-e-Sharif, where the insurgents launched a multi-pronged attack early Saturday.