Unknown assailants threw a homemade bomb at the Tunisian consulate and home of the consul in the Libyan capital late Tuesday, causing some damage but no casualties, officials and witnesses said.
The Tunisian foreign ministry issued a statement saying a "homemade bomb exploded near the consulate causing minor material damage."
A diplomat said Consul General Abdelhamid Errai was in the building at the time of the attack.
The blast chipped an outer wall of the complex, located in Tripoli's Naufliyeen neighbourhood, and slightly damaged two nearby cars, an AFP journalist at the scene said.
A witness told AFP the attack occurred mid-afternoon when a white car sped past and someone hurled a "gelatina" bomb, a small improvised explosive device typical to Libya.
Guards said the incident was captured by security cameras in the premises.
Forces of the interior ministry's Supreme Security Committee arrived at the site shortly after the blast and patrolled the area in search of the culprit, the AFP reporter said.
Still at the scene, the consul declined to comment on the attack. He later downplayed the incident in remarks to Tunisian TAP news agency, saying that "no damage" had been done.
The blast comes amid tensions between Tripoli and Tunis after a former premier of the late Libyan leader, Baghdadi al-Mahmudi was extradited to Libya on Sunday against the wishes of Tunisian President Moncef Marzouki.
It also comes as Libyan medics and officials denied claims by Mahmudi's lawyer that he was beaten and hospitalised after his extradition.
The ex-premier's extradition came as a boon for the ruling National Transitional Council, which is keen to prove that it can conduct fair and safe trials for high profile figures.
But Tunisia's post-revolution political alliance had been plunged into crisis over the affair.
Marzouki is furious that Prime Minister Hamadi Jebali ordered Mahmudi's transfer to Libya without his consent.
Marzouki had always opposed the extradition, arguing that Libya's new regime offered insufficient guarantees of a fair trial. But when Jebali approved the move on Sunday, the president was in southern Tunisia for an official ceremony.
Marzouki, a veteran human rights activist, did not sign the extradition order and an adviser said he only found out about Mahmudi's transfer through the media.