Blasts rang out and helicopters hovered above the PNS Mehran base in the city of Karachi, nearly 12 hours after more than 20 Pakistani Taliban militants stormed the building with guns and grenades, blowing up at least one aircraft.
However, security officials and a senior minister said the operation appeared to be coming to an end.
"A major area has been cleared," Interior Minister Rehman Malik told reporters. "The sweeping process is continuing."
The assault casts fresh doubt on the Pakistan military's ability to protect its bases following an attack on the army headquarters in the city of Rawalpindi in 2009, and is a further embarrassment following the surprise raid by U.S. special forces on bin Laden's hideout north of Islamabad on May 2.
The Pakistan Taliban, which is allied with al Qaeda, said the attack was to avenge the al Qaeda leader's killing.
"It was the revenge of martyrdom of Osama bin Laden. It was the proof that we are still united and powerful," Taliban spokesman Ehsanullah Ehsan told Reuters by telephone from an undisclosed location.
Sporadic bouts of heavy gunfire erupted from the base as security forces battled to end the siege. Twelve military personnel were killed and 14 wounded in the assault that started at 10.30 p.m. on Sunday (1:30 p.m. EDT), a navy spokesman said.
"The operation is still on but resistance from militants has reduced significantly," spokesman Mohammad Yasir told Reuters. A security source said at least three militants had been killed.
GUNS, ROCKET-PROPELLED GRENADES
One security official said the militants had taken over a building in the base. Another official, contacted inside the base, denied reports that hostages had been taken, but added: "There is a chance that some terrorists have suicide belts or jackets."
The base is 15 miles from the Masroor Air Base, Pakistan's largest and a possible depot for nuclear weapons.
"They were carrying guns, rocket-propelled grenades (RPG) and hand grenades. They hit the aircraft with an RPG," Navy spokesman Commander Salman Ali said of the militants.
A spokesman said one P-3C Orion, a maritime patrol aircraft supplied by the United States, had been destroyed and another aircraft had been damaged.
Media reports said the attackers had made their way in through a sewer pipe but that was not confirmed.
TALIBAN DENIES MULLAH OMAR KILLED
Pakistan has faced a wave of assaults over the last few years, many of them claimed by the Pakistani Taliban.
Others have been blamed on al Qaeda-linked militant groups once nurtured by the Pakistani military and which have since slipped out of control.
The Taliban have stepped up attacks since bin Laden's death, killing almost 80 people in a suicide bombing on a paramilitary academy and an assault on a U.S. consular vehicle in Peshawar.
The group also claimed responsibility for a botched plot to bomb New York's Times Square last year.
The TTP is led by Hakimullah Mehsud, whose fighters regularly clash with the army in the northwest, also widely believed to be a base for Afghan militants.
On Monday, an Afghan television station reported Taliban leader Mullah Omar had been killed in Pakistan, but the group denied it, saying he was safe and in Afghanistan.
Washington sees nuclear-armed Pakistan as a key, if difficult, ally essential to its attempts to root out militant forces in neighbouring Afghanistan.
Pakistan, however, sees militant groups as leverage in Afghanistan, and the discovery that bin Laden was living in the town of Abbottabad has revived suspicions that militants may be receiving help from within the security establishment.
Pakistan says its senior leadership did not know bin Laden's whereabouts, but his presence -- and his killing -- has strained already fragile ties United States and deeply embarrassed Pakistan's military.
The military, for its part, has come under intense pressure for allowing five U.S. helicopters to penetrate Pakistan's airspace and kill the al Qaeda leader.
Many U.S. lawmakers are questioning whether to cut the billions of dollars of aid Pakistan receives to help root out militants.
On Monday, the Pakistani rupee fell to a record low against the U.S. dollar, partly because of concerns that growing tensions with the West could choke off much needed foreign aid.