"Signing this agreement with Taliban is an unacceptable risk to America's civilian population," Bolton tweeted on Saturday.
"This is an Obama-style deal," Bolton said, referring to Trump's predecessor. "Legitimizing Taliban sends the wrong signal to ISIS and al Qaeda terrorists, and to America's enemies generally."
Bolton, long considered a foreign policy hawk, left the Trump administration last fall amid disagreements over the administration's approach to Afghanistan and other countries.
During a press conference on Saturday, Trump defended himself against Bolton's criticism. "He should have tried to do something better," he said of Bolton. "He was here for a year. He could have done something better -- I was all ears, and he wasn't able to do that."
He also criticized Bolton for his role in pushing conflict in Afghanistan and Iraq. "He was very much in favor of going in. We should have never gone in in the first place ... when they went into Iraq, when they went into the Middle East in such a fashion, I was very much against it, shouldn't have gone in. He thought we should have -- that's been proven wrong."
Saturday's agreement is aimed at ending the 18-year armed conflict that started when Bolton served as an adviser in former President George W. Bush's administration.
As part of the agreement, the U.S. is drawing back a number of the approximately 13,000 troops stationed there, although more than 8,000 will remain to ensure certain counter-terrorism conditions are met by the Taliban.
Another condition of the agreement calls for the release of 5,000 Taliban members from Afghan-run jails, although it was not clear if the Afghan government will comply with that. A senior administration official told reporters earlier this week that the deal "explicitly mentions al Qaeda" and calls for the Taliban to cut all ties. The U.S. is also working for a "complete ceasefire" which will be discussed in Oslo on March 10.
Bolton's comments were just the latest salvo in an on-going feud between President Trump and his hawkish former adviser. Many saw his place in the administration as a departure from the anti-war tone Trump set during his 2016 campaign.
Amid news Bolton was planning to publish a book, Trump ridiculed him on Twitter. "If I listened to him, we would be in World War Six by now," Trump said.
Secretary of State Mike Pompeo told Taliban leaders in Doha that he would "closely watch the Taliban’s compliance with their commitments and calibrate the pace of our withdrawal to their actions. This is how we will ensure that Afghanistan never again serves as a base for international terrorists."
“This agreement will mean nothing and today’s good feelings will not last if we don’t take concrete actions on commitments and promises that have been made,” Pompeo said, seemingly directed at his counterparts.
Among those in attendance were leaders of the Taliban, who harbored Osama bin Laden and his Al Qaeda network as they plotted, and then celebrated, the hijackings of four airliners that were crashed into lower Manhattan, the Pentagon and a field in western Pennsylvania, killing almost 3,000 people.
Fox News' Paulina Dedaj contributed to this report.