Ghani has come under mounting public criticism for spiralling insecurity, with a wave of protests and deadly street clashes roiling the Afghan capital as people incensed by the violence call for his government's resignation.
The president made a strong plea for security at an international peace conference on Afghanistan attended by around two dozen countries.
Armoured vehicles patrolled the streets as part of tight security and fighter jets roared over the capital.
"We are offering a chance for peace but this is not an open-ended offer," Ghani said.
"Time is running out... this is the last chance: take it or face consequences."
The conference, labelled the "Kabul Process", aims to build international support for peace. There was no immediate reaction from the Taliban to Ghani's comments.
Kabul has been on edge since the massive truck bomb last Wednesday ripped through the city's highly fortified diplomatic quarter, home to the presidential palace and a host of foreign embassies.
The death toll from the devastating attack has jumped to more than 150 people, while over 300 wounded were brought to hospitals, many with burns and amputations, Ghani told the conference.
Previously officials had put the number of dead at 90. Ghani did not immediately explain the much higher figure.
The protesters, holding a sit-in for a fifth day Tuesday near the bombing site, have demanded the resignation of Afghanistan's security chiefs, including national security adviser Hanif Atmar.
The attacks have worsened tensions between rival ethnic groups and raised the prospect of a political crisis.
Foreign Minister Salahuddin Rabbani, who heads the mainly Tajik Jamiat political group, also called for Atmar's dismissal on Monday. But Ghani, an ethnic Pashtun, firmly rejected the demand.
Rabbani survived an attack at the funeral of one of the protesters on Saturday where suicide bombers tore through a row of mourners and killed seven more people.
He blamed "terrorists within the system" for the funeral blasts, suggesting they were an inside job.
The government has accused the Taliban-allied Haqqani Network of carrying out Wednesday's attack, and said the funeral was targeted by bombers trained at a religious seminary in Pakistan.
Previous international efforts to bring the Taliban to the negotiating table have failed, but diplomats in Kabul hailed Tuesday's conference as a stepping stone to peace.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)