BEIRUT (Reuters) - Lebanon’s army said on Saturday it had detained an Islamic State suspect accused of planning attacks against its troops.

The man was sent by Islamic State operatives in Syria to assassinate a senior Lebanese army officer. He had been surveiling the soldier’s home, the military statement said.

“He also worked on securing the necessary weapons and explosives to execute this operation,” as well as bomb attacks against the army and villages in north Lebanon, it said.

Authorities arrested the suspect, a Lebanese national, in the northern village of Wadi Khaled at the border with Syria, a security source said.

In recent years, some attacks in Lebanon have been linked to Islamic State, which controls territory in neighboring Syria and a shrinking enclave on the common border.

Still, the country has mostly escaped the violence unleashed by the six-year Syrian war, where Lebanon’s Shi’ite Hezbollah fights alongside President Bashar al-Assad’s government.

The Lebanese army said the man it detained took orders from Islamic State in the Syrian city of Raqqa, which the militants had used as a base before losing ground there to U.S.-backed militias.

The suspect has also been in touch with militants in the Islamic State enclave among the barren mountains straddling the Syrian-Lebanese frontier.

Since last week, Lebanon’s army has been waging an offensive on its side of the border against the Islamic State pocket near the town of Ras Baalbeck in the northeast.