The blasts, part of a wave of attacks across Afghanistan on Tuesday, took place during rush hour as staff were leaving the complex.
The Taliban said they carried out the attack, targeting members of the Afghan intelligence agency.
In Kandahar, blasts at the governor's guesthouse killed five and injured 14 including the UAE ambassador.
Provincial governor Humayun Azizi was critically injured, his spokesperson told the BBC.
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.
Earlier, in Lashkar Gah, the capital of Helmand, a Taliban suicide bomber targeted a guesthouse used by an intelligence official, killing at least seven people and wounding six others.
The attack in Kabul was the bloodiest to strike the capital for several months. Most of the victims are said to be civilians, including parliament staff.
Reports speak of a suicide bomber striking first, followed by a car bomb.
President Ashraf Ghani vowed that all those behind the "criminal attacks" would be caught.
"The Taliban shamelessly claim credit for the attack on civilians and they're proud of it," he said in a statement.
Afghan sources said a district head of the National Directorate of Security - Afghanistan's main intelligence agency - was among the dead.
An MP from the western Herat province, Rahima Jami, was said to have been injured.
An injured parliament security guard named as Zabi told AFP: "The first explosion happened outside the parliament... a number of innocent workers were killed and wounded. It was caused by a suicide bomber on foot."
He said the car containing a bomb "was parked on the other side of the road and flung me back when it detonated".
Ahmad Wali, police chief of Kabul's district 7, told the BBC the second bomb went off when police went to help the victims of the first.
He said the explosions were close to the gates of the city's American University.
In the Kandahar attack, the governor's spokesperson told the BBC that the explosions took place during a dinner party where the UAE ambassador and other dignitaries were guests.
The ambassador had been in Kandahar to lay down the foundation stone of an orphanage. His exact condition is not clear.
Senior police and intelligence officials were also present, the spokesperson said.