Ghani on Monday threatened diplomatic reprisals against Pakistan if it does not take an action against the Taliban.
"I want to make it clear that we no longer expect Pakistan to bring the Taliban to the negotiating table," Ghani said.
"But we want Pakistan to fulfil its promises ... and take military action against their sanctuaries and leadership based on its soil. If they can't target them, they should hand them over to our judiciary," he said.
"If we do not see a change, despite our sincere efforts for regional cooperation, we will be forced to turn to the UN Security Council and start serious diplomatic efforts," he added.
Ghani made the statement in a new hard-line stance after a brazen insurgent attack last Tuesday left 64 people dead in Afghanistan, Dawn online reported.
The attack on a security services office in Kabul was the deadliest since the Taliban were ousted from power in 2001.
It cast a pall over international efforts in recent months to jumpstart Pakistan-brokered peace talks, which stalled last summer after the Taliban belatedly confirmed the death of their leader Mullah Omar.
Ghani's remarks reflect his frustration after he expended substantial political capital since coming to power in 2014 in courting Pakistan in the hope of pressuring the militants to the negotiating table.
The Pakistani government recently admitted, after years of official denial, that the Afghan Taliban leadership enjoys safe haven inside the country.
Ghani vowed a tough military response against the insurgents and pledged to enforce legal punishments, including executions of convicted militants.
"The time for amnesty is over," he said. "For the Taliban who are ready to end bloodshed, we have left the door open for talks. But the door will not be open forever."
Ghani stopped short of declaring a state of national emergency, pledging war against radical groups like the militant Islamic State group, usually known in Afghanistan as Daesh, or the Haqqani network while suggesting there was still some hope of compromise with at least some Taliban.
"The enemies of Afghanistan are Daesh, Al-Qaeda, the murderous Haqqani network and some of the Taliban who enjoy shedding the blood of countrymen," he said.
Ghani said Taliban leaders sheltering in Peshawar and Quetta were "slaves and enemies of Afghanistan who shed the blood of their countrymen".
He did not mention whose slaves he thought the Taliban were. "There are no good or bad terrorists ... Pakistan should act on them as a responsible government," Ghani said.
Taliban spokesman Zabihullah Mujahid rebuffed Ghani's remarks, reiterating the group would press on with their jihad until the "foreign occupation" of Afghanistan ends.
"The nation is not blind, people understand who the slave is and who works for the interest of others," he said in a tweet.
The Taliban earlier this month announced the start of their annual spring offensive, vowing "large-scale attacks" across Afghanistan.
The announcement came even after a four-country group comprising Afghanistan, the US, China and Pakistan held meetings since January aimed at ending the drawn-out conflict.