KARACHI, Pakistan — In a ferocious terrorist assault that stretched into Monday morning, suspected Islamist militants infiltrated Pakistan’s largest international airport in Karachi, waging an extended firefight against security forces that resulted in 23 deaths and shook the country’s already fragile sense of security.

Explosions and gunfire rang out across the airport through the night as police and security forces battled with attackers, and passengers waited anxiously in a nearby terminal and in airplanes stranded on the tarmac. Just before 5 a.m., after five hours of siege, the military reported that the last of 10 attackers had been killed.

The chief minister of Sindh Province, Syed Qaim Ali Shah, told reporters that in addition to the 10 attackers, 13 other people had died, including 10 members of the Airport Security Forces and a flight engineer with Pakistan International Airlines, the state airline. “They were well trained,” he said of the assailants. “Their plan was very well thought out.”

There was no claim of responsibility for the assault, which was the most ambitious of its kind in Pakistan since Islamist militants attacked a navy air base in central Karachi in 2011. Initial suspicions fell on the Pakistani Taliban and related Islamist groups that have become increasingly strong in the past two years in the city, a sprawling megalopolis of 20 million people and a major commercial hub.