Six gunmen then tried to enter but security officers

two women and two children - were hurt in the attack

This is the terrifying moment a Taliban suicide bomber blew himself up outside the Afghan parliament building this morning, forcing politicians to scramble for cover.

Harrowing footage reveals how the bomber detonated his device inside a car parked at the gates of the building in the capital Kabul, injuring at least 18 people, including two women and two children.

MPs who had gathered to confirm the appointment of a new defence minister were seen running for their lives as six gunmen then attempted to storm the compound, only to be pushed back by security forces and eventually seeking refuge in a nearby building site.

Following a two-hour fire fight, it was confirmed that all seven terrorists - including the suicide bomber - died at the scene. It is understood that no MPs were injured in the attack.

The Taliban released a statement claiming responsibility within minutes of the attack, adding that the meeting to announce Masoom Stanekzai as defence minister had been deliberately targeted.

Scroll down for video

Terrifying: This is the moment a Taliban suicide bomber blew himself up outside the Afghan parliament building this morning, forcing politicians to scramble for cover

Sick: Harrowing footage reveals how the bomber detonated his device inside a car parked at the gates of the building in the capital Kabul, injuring at least 18 people, including two women and two children

Lawmakers: MPs had gathered at the Afghan parliament to confirm the appointment of a new defence minister

The attack began with a car bomb blast near the entrance of the parliament building, Sediqqi said, raising questions about how the driver got through several security checkpoints.

Gunmen then attempted to enter the compound but a firefight with security officials forced them to seek refuse in a nearby building site, which has since been surrounded by police.

Sediqqi said all the MPs inside parliament were safe. Health Ministry spokesman Mohammad Ismail Kahousi said 18 civilians were wounded, mainly as a result of flying glass from the original blast.

Sidiqa Mubarez, an MP, said the building was rocked by a large explosion and that some people were wounded by flying glass. She said the explosion happened shortly after Stanekzai had arrived to be confirmed as defense minister, a post that has been vacant for nine months.

Reporters on the ground heard heavy gunfire outside the parliament and saw black smoke billowing from the entrance as ambulances raced to the scene.

The reporter later heard sporadic shooting from the building where the militants were said to be holed up. Just down the street, hundreds of children were evacuated from a school.

Blast: At least 18 people, including two women and two children, were wounded when a suicide bomber detonated his device inside a car (pictured in flames) parked outside the gates of the parliament building

Fightback: A number of gunmen then attempted to storm the compound but were pushed back by security forces (pictured) and eventually took refuge in a nearby building under construction

Smoke rises from burning vehicles at the site of today's attack in front of the Afghan parliament building

Within minutes of the attack, Taliban spokesman Zabihullah Mujahid posted on Twitter: 'Several mujahideen have entered the parliament building, heavy fighting is on-going.'

'The attack happened at a time when the defence minister was being introduced.'

Lawmaker Farhad Sediqi was among several lawmakers who criticised security agencies for not preventing the attack.

'It shows a big failure in the intelligence and security departments of the government,' he said.

Police denied that Taliban fighters had breached the high-security parliament building and there were no immediate reports of deaths. A thick plume of smoke was seen rising from the building.

'It is a group attack by the Taliban on the parliament,' Kabul police spokesman Ebadullah Karimi said. 'They are not inside the parliament building, but they are somewhere outside the building.'

Taliban insurgents have launched complex attacks on government targets in the capital in the past.

The insurgents have also been advancing across the country's north, capturing two districts of the Kunduz province in as many days.

Smoke rises: Reporters on the ground heard heavy gunfire outside the parliament and saw black smoke billowing from the entrance of parliament as ambulances raced to the scene

Flee: Women are seen leaving central Kabul with their children as smoke rises from the site of today's attack

Security: The Taliban released a statement claiming responsibility within minutes of the attack, adding that the meeting to announce Masoom Stanekzai as defence minister had been deliberately targeted

Mohammad Yusuf Ayubi, head of the provincial council, said the insurgents attacked the district of Dashti Archi from four sides, setting off heavy fighting before seizing full control of the area today.

He said local forces suffered casualties but did not have a precise count.

Ayubi added that around 150,000 residents of the district are unable to leave. The Taliban confirmed the capture of the district, as well as ammunition and four tanks, in an emailed statement.

The Taliban seized control of the Chardara district in Kunduz yesterday.

The insurgents attacked the provincial capital, also called Kunduz, in a surprise attack in April and nearly captured the city before Afghan forces pushed them back.