The Boy Scouts of America on Monday ended its blanket ban on gay adult leaders while allowing church-sponsored Scout units to maintain the exclusion for religious reasons.

The new policy, aimed at easing a controversy that has embroiled the Boy Scouts for years, takes effect immediately. It was approved by the BSA's National Executive Board on a 45-12 vote during a closed-to-the-media teleconference.

"For far too long this issue has divided and distracted us," said the BSA's president, former Defense Secretary Robert Gates. "Now it's time to unite behind our shared belief in the extraordinary power of Scouting to be a force for good."

The stage had been set for Monday's action on May 21, when Gates told the Scouts' national meeting that the long-standing ban on participation by openly gay adults was no longer sustainable. He said the ban was likely to be the target of lawsuits that the Scouts likely would lose.

Two weeks ago, the new policy was approved unanimously by the BSA's 17-member National Executive Committee. It would allow local Scout units to select adult leaders without regard to sexual orientation — a stance that several Scout councils have already adopted in defiance of the official national policy.

In 2013, after heated internal debate, the BSA decided to allow openly gay youth as scouts, but not gay adults as leaders. Several denominations that collectively sponsor close to half of all Scout units — including the Roman Catholic church, the Mormon church and the Southern Baptist Convention — have been apprehensive about ending the ban on gay adults.

The BSA's top leaders have pledged to defend the right of any church-sponsored units to continue excluding gays as adult volunteers. But that assurance has not satisfied some conservative church leaders,'

"It's hard for me to believe, in the long term, that the Boy Scouts will allow religious groups to have the freedom to choose their own leaders," said the Rev. Russell Moore, president of the Southern Baptist Convention's Ethics & Religious Liberty Commission.

"In recent years I have seen a definite cooling on the part of Baptist churches toward the Scouts," Moore said. "This will probably bring that cooling to a freeze."

Under the BSA's new policy:

— Prospective employees of the national organization could no longer be denied a staff position on the basis of sexual orientation.

— Gay leaders who were previously removed from Scouting because of the ban would have the opportunity to reapply for volunteer positions.

— If otherwise qualified, a gay adult would be eligible to serve as a Scoutmaster or unit leader.

Gates, who became the BSA's president in May 2014, said at the time that he personally would have favored ending the ban on gay adults, but he opposed any further debate after the Scouts' policymaking body upheld the ban. In May, however, he said that recent events "have confronted us with urgent challenges I did not foresee and which we cannot ignore."

He cited an announcement by the BSA's New York City chapter in early April that it had hired Pascal Tessier, the nation's first openly gay Eagle Scout, as a summer camp leader. Gates also cited broader gay-rights developments and warned that rigidly maintaining the ban "will be the end of us as a national movement."

The BSA faced potential lawsuits in New York and other states if it continued to enforce its ban, which had been upheld by the U.S. Supreme Court in 2000. Since then, the exclusionary policy has prompted numerous major corporations to suspend charitable donations to the Scouts, and has strained relations with some municipalities that cover gays in their non-discrimination codes.

Stuart Upton, a lawyer for the LGBT-rights group Lambda Legal, questioned whether the BSA's new policy to let church-sponsored units continue to exclude gay adults would be sustainable.

"There will be a period of time where they'll have some legal protection," Upton said. "But that doesn't mean the lawsuits won't keep coming. ... They will become increasingly marginalized from the direction society is going."

Like several other major youth organizations, the Boy Scouts have experienced a membership decline in recent decades. Current membership, according to the BSA, is about 2.4 million boys and about 1 million adults.

After the 2013 decision to admit gay youth, some conservatives split from the BSA to form a new group, Trail Life USA, which has created its own ranks, badges and uniforms. The group claims a membership of more than 25,000 youths and adults.