Tunisian paramilitary police clashed overnight with an armed group from across the border with Libya, hours before President Moncef Marzouki arrived in Tripoli, the TAP news agency said on Monday.
Marzouki went to Libya for talks with officials there on his first state visit abroad since being sworn in last month.
"A patrol of gendarmes exchanged fire with a Libyan armed group that tried to penetrate Tunisian territory. The assailants were forced to pull back," TAP reported, citing Tunisian security sources.
Interior ministry spokesman Hichem Meddeb told AFP that the incident took place between 1030 GMT and 0300 GMT near the Tunisian town of Merissa, in the south.
"Some Libyans aboard three cars who tried to get into Tunisian territory were drunk and for hours did not stop harassing the Tunisian gendarmes," said Meddeb, who added that "nobody was hurt in these clashes".
On Saturday, a dozen armed Libyans kidnapped four Tunisian gendarmes at the border. Three of the paramilitary police managed to escape, leaving behind one Walid Othmani, with their patrol car and their weapons.
Othmani, who had sustained bullet wounds at the hands of the kidnappers, was freed on Sunday by self-proclaimed "Libyan revolutionaries."
During his first visit to Libya, Marzouki was holding talks with senior leaders there before addressing the press. Border security is one of the main points on the agenda.