An Afghan woman was killed and 11 other civilians were wounded in the barrage. Afghan special forces managed to repel the attackers, killing four in an ensuing gunbattle.
Najib Danish, spokesman for the Interior Ministry, said the Taliban fired up to about six projectiles at and near the airport, hitting both the international and the military sector of the sprawling hub and also two civilian houses nearby. The gunbattle with Afghan special forces left "four of the terrorists dead," he said.
Mattis was meeting with Afghan President Ashraf Ghani at the time of the attack, along with visiting NATO Secretary-General Jens Stoltenberg. It was not immediately known if Mattis' plane was damaged on the attack.
Taliban spokesman Zabihullah Mujahid said in a tweet that the "military section of the Kabul airport was hit with missiles; target was plane of U.S. Defense Secretary Mattis" and that "losses (were) caused" in the attack.
Ghani said during a joint press conference with Mattis and Stoltenberg that Afghan special forces troops quickly brought the attack under control. Mattis called the attack "a crime" during the news conference, which was broadcast live.
Tumor Shah Hamedi, director of Kabul airport, said all flights were halted as a result of the attack.
At the presser, both Mattis and Stoltenberg pledged continued support for Afghanistan and vowed to do everything possible so the country "doesn't again become a safe haven for international terrorists."
Stoltenberg said NATO is aware of "the cost of staying in Afghanistan, but the cost of leaving would be even higher."
"If NATO forces leave too soon, there is a risk that Afghanistan may return to a state of chaos and once again become a safe haven for international terrorism," he said.
Stoltenberg also said NATO was committed to funding the Afghan security forces until at least 2020, and would continue to provide them almost a $1 billion each year.
Ghani said the Taliban can choose either to align with international terrorism or renounce violence and join a peace process with the government.
Mattis said Washington supports a negotiated settlement between the Taliban and Afghanistan. "The sooner the Taliban recognize they cannot win with bombs, the sooner the killing will end," he said.
In other violence, hundreds of Taliban insurgents attacked a security post in Afghanistan's western Farha province, killing at least 10 policemen and threatening to overrun the position.
Hakim Noori, the governor of the Pusht Rod district, said almost 300 Taliban fighters took part in the attack, which began on Tuesday night. He said the insurgents mined the area around the base to prevent authorities from sending in reinforcements.
Farid Bakhtawar, the head of the provincial council, confirmed the killing of the policemen and warned they would be overrun if reinforcements do not arrive soon.
Associated Press writer Amir Shah in Kabul contributed to this report.
Send a breaking news alert
Report a correction or typo
Learn more about the 6abc apps