BEIRUT — A Jordanian soldier was killed in clashes with armed militants trying to cross the border into Syria on Monday, and sectarian clashes overnight in Lebanon left four dead as Syria’s civil war spilled into neighboring countries.

Jordanian Information Minister Sameeh Maaytah said the soldier was the first member of the country’s military to be killed in violence related to Syria’s civil war. He died in clashes with militants trying to illegally enter Syria to join rebels fighting President Bashar Assad’s regime. Maaytah did not say whether the militants were Jordanians or foreign fighters trying to jump into the fray in the neighboring country.

A statement by the Jordanian military said the soldier was killed in a shootout with a group of eight suspected militants armed with pistols and machine guns. Jordanian troops detained the suspected gunmen, and authorities are questioning them, the statement said.

In Washington, State Department spokesman Mark Toner blamed Syria, saying “the onus for this kind of violence rests squarely on the Assad regime.”

A number of foreign Islamists have been fighting in Syria alongside the rebels. Jordan’s banned Salafi movement — which promotes an ultraconservative brand of Islam — has sent several fighters to Syria in past months, and Jordanian border patrols have caught some of them recently.

In Lebanon, troops launched a major security operation to open all roads and force gunmen off the streets, trying to contain an outburst of violence set off by the assassination of a top intelligence official who was a powerful opponent of Syria. Sectarian clashes overnight killed at least two people.

Sporadic cracks of gunfire could be heard in the Lebanese capital as troops began the operation a day after the funeral for Brig. Gen. Wissam al-Hassan.

Opponents of Syria have blamed the regime in Damascus for al-Hassan’s killing in a Beirut car bombing Friday.

With Lebanon already tense and deeply divided over the civil war next door, the assassination has threatened to drag the country back into the kind of sectarian strife that plagued it for decades — much of it linked to Syria.

In the Lebanese capital, soldiers backed by armored personal carriers with heavy machine guns took up position on major thoroughfares and dismantled roadblocks. At times, troops exchanged gunfire with Sunni gunmen.