The Karamanli Mosque is probably the most splendid mosque in Tripoli's old medina. Built in 1738 by Ahmed Karamanli, the semi-autonomous Ottoman governor who founded a ruling dynasty, it sits near the castle at the entrance to the main souq. The interior is lavishly decorated with imported Italian tiles, carved stucco, and multiple small domes — a level of ornamentation unusual for North Africa and reflecting the wealth the Karamanli family extracted from piracy and trade.
The octagonal minaret is a local landmark. Ahmed Karamanli and several of his descendants are buried in a mausoleum attached to the mosque. The building is well-maintained and one of the few historic sites in Tripoli that visitors can reliably access.