Tunis iStock

A man attempted to stab police on patrol near a synagogue in the Tunisian capital of Tunis on Tuesday before they overpowered and arrested him, the interior ministry said, according to AFP.

A 45-year-old suspect is accused of trying to attack a pair of police officers in the late morning attack, the ministry said in a statement.

The police managed to stop and arrest the alleged assailant before he was handed over to anti-terror security services. The officers escaped unharmed.

Security was beefed up in the area surrounding the synagogue following the attack.

The suspect was from Ettadhamen, an impoverished area in the Tunis suburbs, national security spokesman Walid Ben Hkima said.

An investigation has been launched to determine the motive for the attack and any possible links to extremist groups.

Tunisia has been under a state of emergency since a series of jihadist attacks in the country in 2015, although the security situation has improved significantly in the past two years.

Earlier this month, thousands of people took part in the annual Jewish pilgrimage in celebration of Lag Ba’omer to the Tunisian island of Djerba, home to Africa's oldest synagogue.

The Jewish population of Tunisia, which was estimated at about 100,000 individuals in 1948, was only 1,500 in 2003. As of 2011, 700 Jews were living in Tunis and 1,000 on the island of Djerba.

In January, the El Ghriba synagogue was attacked with a firebomb which caused minor damage and no injuries. The incident occurred amid protests over economic conditions taking place in several Tunisian cities.

Five men were later arrested in connection with the firebomb attack.

In 2002, terrorists blew up a vehicle near the El Ghriba synagogue, killing 21.

While extremist groups in Tunisia have been weakened, the country continues to suffer from attacks, noted AFP.

In November, two police officers were stabbed in front of parliament by a young Tunisian who authorities believe had been radicalized. One of the officers later died from his wounds.

In 2015, a gunman killed 38 tourists, mostly Britons, in the coastal resort of Sousse.