Since the overthrow of Colonel Qaddafi, Tripoli has slid steadily into lawlessness, with no strong central government or police presence. It has become a safe haven for militants seeking to avoid detection elsewhere, and United States government officials, speaking on condition of anonymity to discuss confidential information, have acknowledged in recent months that Abu Anas and other wanted terrorists had been seen moving freely around the capital.

The operation to capture Abu Anas was several weeks in the making, a United States official said, and President Obama was regularly briefed as the suspect was tracked in Tripoli. Mr. Obama had to approve the capture. He had often promised there would be “no boots on the ground” in Libya when the United States intervened there in March 2011, so the decision to send in Special Operations forces was a risky one.

American officials said they would want to question Abu Anas for several weeks. But they did not dispute that New York, where an indictment is pending against him, was most likely his ultimate destination. Mr. Obama has been loath to add to the prisoner count at the American military facility at Guantánamo Bay, and there is precedent for delivering those suspected of terrorism to New York if they are under indictment there.

The operation will do nothing to quell the continuing questions about the events in Benghazi 13 months ago that led to the deaths of four Americans. But officials say the operation was a product of the decision after Benghazi to bolster the counterterrorism effort in Libya, especially as Tripoli became a safe haven for Qaeda leadership.

The capture of Abu Anas also coincided with a fierce gunfight that killed 15 Libyan soldiers at a checkpoint in a neighborhood southeast of Tripoli, near the traditional home of Abu Anas’s clan.

A spokesman for the Libyan Army general staff, Col. Ali Sheikhi, said five cars full of armed men in masks pulled up at the army checkpoint at 6:15 a.m. and opened fire at point-blank range. It was not clear if the assault at the checkpoint was related to the capture of Abu Anas or his removal from Libya.

Image Credit... The New York Times

The raid in Somalia was the most significant raid by American troops in that lawless country since commandos killed Saleh Ali Saleh Nabhan, a Qaeda mastermind, near the same coastal town four years ago. The town, Baraawe, a small port south of Mogadishu, is known as a gathering place for the Shabab’s foreign fighters.