The officials said the dead included 10 off-duty soldiers. The blast occurred Wednesday morning when a roadside bomb went off on a busy main street of Tripoli as a public bus drove by.
It raised suspicions that al Qaeda-inspired Islamic militants may have sought revenge on the military for last year's fatal clashes.
But local media also link the bombing to tensions ahead of a visit later Wednesday by Lebanese president Fuad Saniora to Syria to patch up stormy relations between the neighbors.
Television footage showed a small public bus riddled with shrapnel from the blast. Shattered glass could be seen in the Banks Street in Tripoli's center.
The officials spoke on condition of anonymity because they are not authorized to speak to the media.
Tripoli has witnessed sectarian clashes in the past weeks that killed and wounded dozens of people.
The city is also close to the Palestinian refugee camp of Nahr el-Bared, which witnessed deadly clashes last year between Lebanese troops and members of the al Qaeda-inspired group Fatah Islam.
The explosion comes at an especially sensitive time for Lebanon. After weeks of struggling, the parliament on Tuesday approved a national unity government that gives the Iranian-backed Hezbollah opposition a more powerful say in the running of the country.
Also Wednesday, Lebanese President Michel Suleiman was expected on a landmark visit in Syria - the first visit by a Lebanese president in about three years amid soured relations between the two neighbors.