The attacks in Kabul on Saturday night came within an hour after Kerry had departed Afghanistan, following a visit aimed at defusing a political crisis in the unity government he helped build.
No casualties resulted from the attacks, according to Afghan government spokesman Sediq Sediqqi.
But they underscored the volatile security situation in the country as warmed weather brings increased fighting.
There was no additional information to verify the Taliban's claim, but CNN's team in Kabul heard four loud explosions near the diplomatic area of the city Saturday night.
Unity government in crisis
Kerry's visit, aimed at urging Afghanistan's President Ashraf Ghani and Chief Executive Abdullah Abdullah to set aside their rivalries, came at a pivotal moment for Afghanistan.
After a bitterly fought presidential election in 2014, Ghani and Abdullah share power in a national unity government that Kerry helped negotiate.
But 18 months into their five-year term, the two rivals have been unable to reconcile their differences and remain deadlocked over key ministries. Several ministers have resigned, others have yet to be confirmed by parliament, and still others face losing their jobs over corruption and mismanagement.
During his visit, Kerry warned their infighting could paralyze the country and dampen the confidence of the international community.
"We need to make certain that the government of national unity is doing everything possible to be unified and to deliver to the people of Afghanistan," Kerry said in an address to the U.S.-Afghanistan Bilateral Commission, which he hosted with his counterpart, Foreign Minister Salahuddin Rabbani.
Afghan polls show dissatisfaction with the two leaders.
A March report by the United Nations warned that "for 2016, survival will be an achievement" for the Afghan government, which faces a contracting economy, ongoing Taliban attacks, a stalled peace process, a divided political setting and an ongoing need for international support.
Kerry: Find compromise
Kerry urged the leaders to find compromise ahead of the upcoming NATO summit in Poland in July and the Brussels Ministerial Conference on Afghanistan in October, in order to give coalition members and donor nations confidence in the government.
"Democracy requires credible institutions. Even more than that, it requires the willingness of various political, ethnic and geographic factions come together and work for common good," Kerry said during a news conference with Ghani.
Ghani thanked Kerry and the American people for their commitment to Afghanistan. He promised the government would work hard over the coming months to prove to other countries that their aid and sacrifice in blood and treasure were well spent.
U.S. President Barack Obama flagged Afghanistan's problems in October, when he announced he would significantly slow the withdrawal of U.S. troops, leaving 9,800 troops in the country through 2016 to train Afghan forces and go after al Qaeda and ISIS.
"After so many years of war, Afghanistan will not be a perfect place," he said. "There will continue to be contested areas and Afghan forces still aren't as strong as they need to be as they face an intensifying Taliban insurgency."
Obama called Afghanistan a key part of a counterterrorism network the United States uses to deal with threats and prevent attacks on the homeland. Maintaining troop levels to better train Afghan soldiers, he said, is crucial "because if they were to fail, it would endanger the security of us all."
The Afghan government hopes to jump-start stalled reconciliation talks with the Taliban. The two sides met last summer, but the talks were stymied following the announcement of the death of Taliban leader Mullah Omar.
In December, the United States, Afghanistan, Pakistan and China joined talks to help facilitate the Afghan-led process, but the Taliban have been unwilling to come back to the table.
Fighting season approaches
With the summer season approaching, it is unclear what incentive the militants have to return to negotiations.
The Taliban have been gaining ground, particularly in Helmand province, where they control a third of the province's 14 districts. ISIS is also expanding its presence in Afghanistan, as some members of the Taliban have shifted allegiance to the group.
A senior State Department official pointed to "challenges" for the Taliban, including the growing strength of the Afghan forces, the death of Omar and defections by senior commanders to ISIS, which is seeking to expand its presence in the country.
"What this suggests to us is that there may in fact be an opportunity for coming to the table and talking to the Afghan government, and we want to encourage that," the official said.
The official said that despite suffering huge loses and facing several challenges from the Taliban over the last year, Afghan forces have been able to retake the key northern city of Kunduz and hold Helmand, and have helped the government maintain control of Kabul and all the major cities.
"The Taliban ... took their best shot at the Afghan National Security Forces," the official said. "Our belief is that the ANSF has demonstrated a willingness to fight and, indeed, has fought pretty courageously."
Still, the U.S. special inspector general for Afghanistan reconstruction said in a recent report it was unlikely that a "robust and sustainable" force would emerge without a continuing strong U.S. and NATO presence.
Troop levels under review
While in Kabul, Kerry met with Gen. John Nicholson, the new commander of U.S. and NATO forces in Afghanistan, who is currently reviewing troop levels in Afghanistan. He also greeted U.S. and NATO troops to thank them for their service.
Nicholson's predecessor, Gen. John Campbell, suggested as he was leaving the post that the United States may have to leave a larger presence to train and assist Afghan forces, as well as dial up pressure on the Taliban with airstrikes.
Current rules of engagement only allow U.S. commanders to call in airstrikes to protect NATO troops and Afghan forces in imminent danger of being overrun by the Taliban. They can target al Qaeda and ISIS militants but cannot conduct airstrikes against the Taliban unless they pose a direct threat to NATO or Afghan forces.
Campbell told reporters that in order to drive the Taliban toward reconciliation, "They need to have more pressure put on them and one way to do that would be potentially striking them."