Two large bombs - one triggered by a suicide attacker - have exploded near government offices, killing at least 38 people and wounding dozens of others in the deadliest Taliban violence in Kabul in months.
In southern Afghanistan, another attack at a guesthouse belonging to the governor of Kandahar province killed five people and wounded 12. An ambassador from the United Arab Emirates and other UAE diplomats were among the wounded, authorities said.
The Kabul suicide bomber struck as workers were leaving a compound of government and legislative offices, said Interior Ministry spokesman Sediq Sediqqi. The second bomb, which was planted in a car, exploded minutes later after security forces had rushed in to help the victims, he said.
The Taliban, who have been waging a 15-year war against the US-backed government, claimed the attack in the capital.
The 38 dead included civilians and military personnel, and another 72 people were wounded, said Public Health Ministry official Mohibullah Zeer.
Among the wounded was Rahima Jami, a member of parliament from Herat province in western Afghanistan, said another politician from the province, Ghulam Faroq Naziri.
It appeared to be the deadliest attack in Kabul since July, when two suicide bombers struck during a demonstration held by Hazaras, a Shi'ite Muslim ethnic group, killing 80 people. That attack was claimed by a local affiliate of the Islamic State group.
In Kandahar, provincial governor Humayun Azizi was critically injured in the attack on his guesthouse.
The UAE foreign ministry called it a "heinous terrorist attack" in which ambassador Juma Mohammed Abdullah al-Kaabi "and a number of Emirati diplomats" were wounded.
The ambassador and other dignitaries were attending a dinner party when the attack happened.
President Asharf Ghani strongly condemned the bombings in a statement from the presidential palace.
The White House also condemned the attacks, saying of the bombings in the capital: "An attack on parliamentary buildings and lawmakers is clearly an assault on Afghanistan's efforts to build democratic institutions."