Tunisia has completed the construction of a 125-mile barrier along its border with Libya, hoping to keep militants out of its territory, Tunisia’s Defense Minister Farhat Horchani announced Saturday. Construction of the barrier, which is expected to be fitted with electronic monitoring systems, was announced last year after a deadly attack by militants affiliated to the Islamic State group killed nearly 40 people at a Tunisian beach resort.

“Today we finished closing it off, and this will help us protect our border, and stop the threat,” Horchani reportedly said. Tunisian security forces claim that the barrier — made of sand banks and water trenches — has already helped reduce cross-border smuggling.

During a visit to the border Saturday, Horchani told reporters that German and U.S. military trainers would train Tunisian forces, and help install electronic surveillance equipment near the earthen wall and trenches, located just over a mile from the Libyan border.

Libya, since the ouster of Moammar Gadhafi in 2011, has been beset with instability. Currently, two rival groups stake claim to rule over the country, with one of them — the elected and internationally-recognized government — maintaining only a tenuous grip over the eastern region of Cyrenaica.

As a result of the protracted and violent conflict in the country, ISIS fighters have established a stronghold in the central coastal city of Sirte, and have advanced toward nearby oil sites in Sidra and Ras Lanuf.

According to some estimates, more than 3,000 Tunisians have joined ISIS and other militant groups in Syria and Iraq. On Saturday, however, Hachani reportedly said that many Tunisians had returned to North Africa to join the group in Libya.

Last year, ISIS claimed responsibility for two major attacks in Tunisia, one at a museum in Tunis and the other targeting a beach hotel in Sousse. According to Tunisian security officials, the attackers had trained at an ISIS-run camp in Libya, underscoring a growing threat posed by Tunisians crossing the border to join the ranks of the Sunni militant group.