Residents drive over debris in a damaged street in Old Aleppo, Syria August 20, 2015. REUTERS/Abdalrhman Ismail (Stringer/Reuters)

The United States’ botched effort last month to support a Syrian moderate rebel group known as Division 30 was a chain of errors that recalls, in a small way, the 1961 Bay of Pigs fiasco.

The Division 30 debacle has some clear and disturbing lessons: The rebels weren’t well prepared for their mission, and they had poor intelligence about potential adversaries inside Syria. The United States was too dependent on Turkey, and it didn’t have clear plans about how to respond if the rebels were attacked; although the United States eventually provided air support, it was too late to do much good.

Division 30 was the first contingent of Syrian rebels deployed under a $500 million “train and equip” plan authorized last year by Congress. It’s an overt program, run by U.S. Special Operations forces, separate from a parallel covert program run by the CIA. The idea is to generate more than 5,000 trained fighters a year who could help clear out Islamic State extremists from Syria and then hold the ground.

Many Syria analysts applauded the idea. By helping to secure a safe zone in northern Syria, the force could facilitate humanitarian assistance and help provide greater security for the devastated population, in addition to pushing back the extremists. But the idea never had strong support from a White House that has been allergic to Syrian intervention.

Division 30 appears to have walked into a trap soon after its U.S.-trained contingent of 54 fighters entered Syria on July 12 to join up with fellow rebels at Azaz, just south of the Turkish border town of Kilis. Nearby were extremist fighters from Jabhat al-Nusra, the al-Qaeda affiliate in Syria, but commanders didn’t think Jabhat al-Nusra would attack. That expectation proved wrong.

The Jabhat al-Nusra extremists regarded Division 30 fighters as “American agents,” according to their Web postings. They kidnapped seven Division 30 fighters on July 29 and attacked its headquarters at Azaz on July 31. Jabhat al-Nusra kidnapped at least five more fighters a few days later. The United States launched airstrikes July 31, but they had little effect.

A Jabhat al-Nusra fighter named Ahamed Shaheed boasted online Thursday: “Just got a bran new M16 taken as ganimah [war spoils] from Division 30 haha,” according to monitoring by Site Intelligence Group.

Division 30’s difficulties illustrate U.S. problems working with Turkey. The rebel group was composed mainly of Syrians from the Turkmen ethnic group, recruited from an area north of Aleppo. The United States had preferred a plan to insert Kurdish and other Sunni fighters closer to Raqqa, the Islamic State’s self-proclaimed capital. But the Turks vetoed that plan.

The Division 30 recruits were perhaps too boastful about their U.S. links. A Twitter account maintained by the group included some unlikely posts: One showed the iconic image of Iwo Jima Marines, but raising a Syrian rebel flag; another displayed a bald eagle wrapped in Syrian colors; a third featured a bald eagle in a rebel crest.

A vivid portrait of Division 30’s situation inside Syria comes from Jenan Moussa, a gutsy reporter for an Arabic television network called Al Aan. She interviewed Abu Iskandar, a Jordanian-trained rebel who is one of the group’s leaders, on Thursday in the countryside north of Aleppo. She e-mailed me English translations of some of his comments.

“We were surprised by the attack by Nusra, because we coordinated in advance with Nusra,” Abu Iskandar said. “Four months ago, Nusra showed great admiration for the training project. Nusra said . . . go get guns and come fight [the Islamic State].”

Moussa said that although Abu Iskandar claimed he had 33 U.S.-trained fighters still with him, she saw only three. The rebel leader didn’t seem bitter. “He doesn’t bear any grudge against the U.S.,” Moussa said. “He was surprisingly optimistic and [said] that eventually 17,000 moderate forces trained by [the] U.S. will come to Syria.”

Given the United States’ history of mismanaging military support for rebel groups over many decades, it’s a wonder that people like Abu Iskandar still want to enlist. When the CIA landed a Cuban rebel force at the Bay of Pigs in 1961, the U.S. failed to provide adequate planning, intelligence, air cover or political support. According to Evan Thomas’s 1995 book “The Very Best Men,” a Cuban operative abandoned on the beach cursed his American handler in a last radio transmission: “And you, sir, are a son of a bitch.”

Many Syrians surely feel a similar anger, but they still seem to want U.S. help. The Syria nightmare deserves a coherent U.S. strategy — including new lessons learned from Division 30.

Read more from David Ignatius’s archive, follow him on Twitter or subscribe to his updates on Facebook.