US Defense Secretary Jim Mattis was the intended target of a rocket attack near an Afghanistan airport on Wednesday, according to the Taliban.

A video has been released showing a militant firing one of the 40 rockets, which killed at least one Afghan woman and injured 11 others.

Another 29 rocket-propelled grenades were fired toward Kabul international airport after Mattis touched down.

Mattis condemned the attack as a 'criminal act by terrorists', adding that it was a 'classic definition of what the Taliban are up to here now'.

The Taliban claimed responsibility and its spokesman, Zabiullah Mujahid, tweeted that Mattis' plane had been the target of the attack.

Scroll down for video

US Defense Secretary Jim Mattis was the intended target of a rocket attack at Kabul international airport on Wednesday, according to the Taliban. He is pictured above arriving at Resolute Support Mission headquarters in Kabul on Wednesday

Multiple rockets landed near Kabul's international airport on Wednesday after US Defense Secretary Jim Mattis flew to the Afghan capital for talks, an official said

The volley of missiles struck near the military section of the airport, said Afghan interior ministry spokesman Najib Danish.

Danish said Afghan security forces surrounded an area where where they suspected the rockets might have been fired.

'A search operation is underway in the area by police units,' he said.

Special forces troops brought the attack under control and three of the people involved were all killed, according to Danish.

The attack came hours after Mattis arrived in the Afghan capital - the first member of Donald Trump's cabinet to visit the war-torn country since his pledge to stay the course in America's longest war.

Officials said the airport and immediate area was evacuated and all flights had been cancelled, according to an Afghan news channel.

The Islamic State also claimed responsibility for the attack via the group's AMAQ news agency.

The news agency said 'infiltrators' used SPG-9 rockets and mortars for the attack.

Zabihullah Mujahid, a Taliban spokesman, claimed responsibility for the attack on his official Twitter account

The volley of missiles struck near the military section of the airport, said interior ministry spokesman Najib Danish

US generals have for months been calling the situation in Afghanistan a stalemate

Police have cordoned off the area to find the exact location from which the rockets were fired

The unannounced high-level visit comes as Afghanistan's beleaguered security forces struggle to beat back the Taliban. Pictured, a US UH-1N military helicotper hovers over the scene after six rockets were fired near Kabul airport

The unannounced high-level visit comes as Afghanistan's beleaguered security forces struggle to beat back the Taliban, which has been on the offensive since the withdrawal of US-led NATO combat troops at the end of 2014.

Mattis, along with NATO chief Jens Stoltenberg, will meet President Ashraf Ghani and other top officials to discuss the US-led NATO 'train and assist' mission designed to strengthen Afghanistan's military so it can defend the country on its own.

'Discussions will focus on the NATO-Afghanistan partnership, including the ongoing NATO-led Resolute Support Mission in support of the Afghan National Defence and Security Forces,' a statement on Resolute Support's Facebook page said.

US generals have for months been calling the situation in Afghanistan a stalemate, despite years of support for Afghan partners, continued help from a NATO coalition and an overall cost in fighting and reconstruction to the United States of more than $1 trillion.

The war turns 16 in October and America is pressing NATO partners to increase their own troop levels in the country to help Afghan forces get the upper hand in the grinding battle against the Taliban and the Islamic State group.

Afghan security forces take security measures after militants carried out a rocket attack at Kabul International Airport

The attack came hours after Mattis (right) arrived in the Afghan capital to hold talk with Afghan President Ashraf Ghani (left) on Wednesday

U.S. Defense Secretary James Mattis and NATO Secretary General Jens Stoltenberg (C) are welcomed by U.S. general John Nicholson

The resurgent Taliban have promised to turn Afghanistan into a 'graveyard' for foreign forces and have been mounting deadly attacks as they maintain their grip on large swathes of the country.

As of February only about 60 percent of Afghanistan's 407 districts were reported to be under government control, according to the US watchdog agency SIGAR.

Under Trump's plan, the US is sending more than 3,000 additional troops to Afghanistan, on top of the 11,000 already on the ground, to train and advise the country's security forces.

NATO allies have around 5,000 troops deployed around the country.

Mattis flew to Kabul from New Delhi where he met his Indian counterpart Nirmala Sitharaman, who made it clear that India would not deploy troops to Afghanistan as part of Trump's strategy.

Afghan security officials secure the scene after six rockets were fired near Kabul