This video still purports to show Abu Bakr al-Baghdadi, the leader of the Islamic State group, delivering a sermon at a mosque in Iraq. (AP)

Lebanon’s military has detained a wife and child of the leader of the Islamic State, security officials said Tuesday.

The spouse of another senior Islamic State commander was also detained by the army, officials said. The women and child might be able to offer insights into the activities of Abu Bakr al-Baghdadi and his inner circle. Or they could become bargaining chips for the release of hostages held by the militant group.

A Lebanese intelligence official identified Baghdadi’s wife as Sagia Dulaimi and said she was detained last week with her 9-year-old daughter at the Madfoun checkpoint in northern Lebanon.

Other media reports, including from the Associated Press, identified the child as a boy. The reason for the discrepancy was not immediately clear.

Baghdadi’s wife and child were carrying false identity papers after crossing from Syria, said the official, who was involved in interrogating the detainees. He said they were Syrian nationals, but other security officials said they could be Iraqi.

The pair were being held at a Defense Ministry compound on the outskirts of Beirut, said the official, who spoke on the condition of anonymity, citing a lack of authority to discuss the issue on the record.

The second woman is of Chechen origin, said a Lebanese military official. The official, who also spoke on the condition of anonymity, declined to give her identity or the name of her husband.

It was not immediately clear whether the woman was detained at the same time as the wife and child of Baghdadi, an Iraqi whose real name is Ibrahim al-Samarrai.

It also remains uncertain why the detainees came to Lebanon, where the Islamic State, a radical al-Qaeda offshoot also known as ISIS or ISIL, is opposed by both the country’s Western-allied military and the powerful Iranian-backed Hezbollah militia.

The military official said a number of family members of Islamic State militants had taken refuge in northern Lebanon, where there are pockets of support from groups such as Jabhat al-Nusra, or al-Nusra Front, al-Qaeda’s affiliate in Syria.

The three detainees could be used to bargain for the release of hostages held by the Islamic State, which has kidnapped thousands of people — including Arabs, Turks, Kurds, Europeans and Americans — to extract ransoms or punish those it considers guilty of religious transgressions. The militants also have beheaded captives, including two American journalists as well as American and British aid workers — in response to airstrikes by a U.S.-led coalition, the Islamic State has said.

The intelligence official said Dulaimi was part of a prisoner swap this year between the Syrian government and rebels in Maaloula, a city in Syria. The government of Bashar al-Assad agreed to release 150 prisoners in exchange for Greek Orthodox nuns who are believed to have been held by militants with links to groups such as al-Qaeda.

In August, militants sympathetic to the Islamic State attacked the northern Lebanese town of Arsal and captured more than 20 soldiers before withdrawing. They have since beheaded two of the soldiers, demanding that Lebanon release a number of jihadists it has jailed.

The Lebanese daily As-Safir was first to report on the detentions of Baghdadi’s wife and child, whom it identified as a son. The paper added that the arrests were made in “coordination with foreign intelligence agencies.”

After lightning advances in Iraq this year by the Islamic State, Baghdadi declared a caliphate on land under the group’s control, which extends from deep inside Iraq to northern Syria.

It is unclear how many wives Baghdadi has, although Islamic law generally allows four.

Meanwhile, at least six Lebanese soldiers were killed by gunmen in an ambush in a border area Tuesday, the AP reported, citing a security official. Details on the assailants were not immediately known, but there have been previous clashes near the Syrian border involving security forces and militant groups including Jabhat al-Nusra.

Brian Murphy in Washington contributed to this report.