CAIRO — The main figure killed in last month's U.S. raid in Yemen targeting al Qaeda was a tribal leader who was allied to the country's U.S.- and Saudi-backed president and had been enlisted to fight Yemen's Shiite rebels, according to military officials, tribal figures and relatives.

The government connections of tribal chief Sheikh Abdel-Raouf al-Dhahab raise further questions over the planning of a raid that turned into a heavy firefight with casualties on both sides.

One U.S. Navy SEAL was killed, six American soldiers were wounded and a military aircraft suffered a hard landing and had to be destroyed in the assault, which took place days after President Donald Trump's inauguration.

Survivors and witnesses say at least 25 Yemenis were killed, including 10 children and nine women, raising outrage in Yemen and prompting the government to ask Washington for a review of the Jan. 29 assault on the tiny village of Yakla.

The raid illustrated the murkiness in distinguishing al Qaeda in Yemen, where the terror group has built up ties of one degree or another with the country's many tribes — and has often used anger over civilians killed in American airstrikes to gain recruits.

"There was random shooting at anything that moved, the entire place was on fire"

Al Qaeda has also emerged as a de facto ally of the government of President Abed Rabbo Mansour Hadi and his backers Saudi Arabia and the United Arab Emirates against the Shiite rebels in a grueling civil war that has wreaked devastation, caused widespread hunger and killed more than 10,000 since late 2014. The result has been a tolerance for the militants after several years of the government cracking down on them.

In Yakla, there was some al Qaeda presence. At least six of those killed in the raid were al Qaeda fighters, according to a list put out by the group's leader, though some witnesses said they arrived on the scene after the battle started. Also, a female Saudi al Qaeda militant who fled her homeland in 2013 was being sheltered in the home of a tribesman whose son was also a member, according to tribal leaders and officials.

But all appeared to be low-level operatives. Also among the dead was an elderly sheikh trying to win the release of a fellow tribesman abducted by the terror network.

A senior U.S. defense official said the assault was not targeting a particular individual and was geared toward — and succeeded in — capturing intelligence. The official spoke on condition of anonymity to discuss the operation.

U.S. Central Command said 14 al Qaeda militants were killed. It counted among them al-Dhahab and his brother Sultan, calling them "top operational planners and weapons experts."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

But Yemenis in the village called the raid an intelligence failure. "If you want to hunt al Qaeda, you can find them in the surrounding mountains not in this small village ... The Americans' information was wrong," said Aziz Mabkhout, the village chief.

Parts of the al-Dhahab clan have long been connected to al Qaeda. But in a public ceremony aired on Yemeni TV in 2013, Abdel-Raouf, Sultan and another brother announced an accord with the governor of Bayda province to force al Qaieda out of the area.

Just before the raid, Abdel-Raouf was in the neighboring province of Marib, meeting with the military chief of staff in Hadi's government. The meeting was confirmed by al-Dhahab's top aide, Fahd al-Qasi, who accompanied him, and two military officials who witnessed or helped arrange the meeting. The two officials spoke on condition of anonymity to discuss the meeting.

During five days of talks with the military, al-Dhahab — who commands a force of some 800 tribal fighters — was given around 15 million Yemeni riyals ($60,000) to pay his men in the fight against the rebels, al-Qasi and the two officials said. He returned home to Yakla and the evening before the raid, al-Qasi distributed the money to the fighters.

Maj. Gen. Mohsen Khasrouf —head of the military's Morale Guidance unit, the equivalent of a spokesman's office — told Al-Arabiya TV that al-Dhahab was working with Hadi's government to retake the nearby city of Radaa from the rebels.

The al-Dhahab clan is a powerful force in Bayda province, originally made up of 18 brothers and half-brothers. The family had long been split in a struggle for leadership, with one part joining al-Qaeda. At least three of the brothers were senior al Qaeda figures, two of them killed in U.S. drone strikes and a third, Tareq, killed in a family dispute. Giving al Qaeda further leverage in the family, one of the sisters was married to Anwar al-Awlaki, a Yemeni-American who was the branch's top propagandist until he was killed in a 2011 drone strike.

Anwar al-Awlaki in Oct. 2008. Anonymous / AP file

But Abdel-Raouf, who became the clan's leader in 2012 after Tareq's death, repeatedly denied belonging to al Qaeda. He was mistrusted by al Qaeda because he didn't swear allegiance to its leader and had links to the government, according to a relative and a prominent figure from another tribe in the area. They spoke to the AP on condition of anonymity for fear of trouble with the terror group.

Hadi's government spokesman, Rageh Badi, did not reply to the AP's request for comment. AP emails to the vice president's office also received no reply.

U.S. officials did not immediately reply to queries whether planners were aware of al-Dhahab's link to Hadi's government.

Since al Qaeda's branch in Yemen began in 2007, it has sought to strengthen alliances with the country's tribes, using money, family connections and fear. Some tribes join it, some use it against rivals, some cooperate with it, and some shun it. Some tribes split.

Complicating matters further, al-Qaeda militants have been fighting the Shiite rebels since 2015 informally alongside pro-Hadi forces. They often operate closely with ultraconservative Islamist militias funded by Hadi's allies Saudi Arabia and the United Arab Emirates. That has enabled them to move back into areas they were previously driven out of, including Bayda province.

The AP spoke to eight witnesses and survivors of the raid, along with several prominent local tribal figures.

According to their accounts, it began around 1:30 a.m. when U.S. special forces descended on Yakla, in a sparsely populated area of Bayda province. Fighters in the village opened fire, and a battle erupted, with aerial bombardment and firing from attack helicopters. Fighting lasted several hours and at least three houses were destroyed.

"Nothing survived, even the cows and the sheep were shot dead," said Sheikh Ahmed al-Salami, who lived not far from al-Dhahab and was among the villagers who got out their personal weapons to fight back against the attackers.

The center of the raid appeared to be six houses belonging to al-Dhahab family and Abdullah Mabkhout al-Ameri, head of another prominent local family. One of al-Ameri's sons, Mohammed, an al Qaeda member, was home at the time of the raid, according to several villagers. Also staying in an annex to the house were the fugitive Saudi female jihadi, Arwa al-Baghdadi, her brother — also an al Qaeda militant — and his pregnant wife and their niece. The tribal leaders and officials said they believed Mohammed had housed them.

All but the niece were killed.

A map showing the location of Yemen. Google Maps

Caught in the al-Dhahabi house was a delegation of 15 men from another family who had come seeking al-Dhahab's mediation for the release of a relative snatched by al Qaeda. The family's leader, Sheikh Seif al-Joufi, in his 80s, stepped out of the house and was shot dead, according to several witnesses.

"There was random shooting at anything that moved, the entire place was on fire," said Abdullah al-Joufi, a member of the delegation. "If you have a head, you better keep it down. This is what we did."

From the al-Dhahab family, besides Abdel-Raouf and Sultan, three children were killed, including the 8-year-old daughter of Anwar al-Awlaki. Al-Awlaki's elder son, 16-year-old Abdel-Rahman, was killed by a drone in 2011.

An image of 8-year-old Nora Anwar al-Awlaki, the daughter of Anwar al-Awlaki who was killed during a raid in Yemen. Yemeni media / via Twitter

The al-Ameri family suffered the most dead: five women, six children, Abdullah, his son Mohamed and another man, according to Saleh Mohsen al-Ameri, who was one of the tribesmen who received money the night before to fight the rebels.

Trying to escape the fighting, Saleh's daughter Fatim dashed from the house with one of her six children. She was shot dead, he said.

"Hours later, we pulled her body back and found the child unconscious but alive, covered in his mother's blood."