Olivier Douliery / ABACAUSA Scouts for Equality holds a rally to call for equality and inclusion for gays in the Boy Scouts of America at the Boy Scout Memorial in Washington, D.C., on May 22 2013.

You can now be gay and a Boy Scout.

The Boy Scouts of America voted Thursday afternoon to allow openly gay youth into their ranks, overturning a ban that had stood for more than 100 years. The group’s 1400-member National Council was closely divided, with 61% voting in favor of accepting gay youth and 39% voting against repeal of the ban.

The decision marks a dramatic change for the venerable organization. Since it was written, the Scout oath has been a mirror of American values. “On my honor I will do my best to do my duty to God and my country and to obey the Scout Law,” it reads, “ to help other people at all times; to keep myself physically strong, mentally awake, and morally straight.” The Boy Scouts’ decision today means the organization no longer considers “morally straight” and “sexually straight” to be the same thing.

That is a distinction that scouting families and outside groups have fought over for months. The issue drew fierce lobbying and took on the flavor of a national political campaign. Scouts for Equality employed Obama campaign data-crunching tactics to mobilize on behalf of the ban’s repeal. The Family Research Council, a social-conservative group opposed to gay marriage, organized a task force to keep it in place. Corporations like Intel and Merck put their BSA funding on hold. “Call Me Maybe” Carly Rae Jepson refused to sing for a Boy Scout concert in March. And on both sides, people prayed that the organization’s decision would reflect their moral beliefs.

The repeal had support from core BSA leadership. “The BSA’s executive committee unanimously presented this resolution because it stays true to Scouting’s mission and remains focused on kids,” BSA president Wayne Perry wrote in USA Today on Wednesday. “No matter what your opinion is on this issue, America needs Scouting, and our policies must be based on what is in the best interest of our nation’s children.”

Scouts for Equality started fighting to overturn the ban last year. Founder Zach Wahls, a 21-year-old Eagle Scout with two mothers, hired twenty staffers and organized hundreds of volunteers to promote the ban’s repeal. “Today’s vote ending discrimination of gay Scouts is truly a historic moment and demonstrates the Boy Scouts of America’s commitment to creating a more inclusive organization,” Wahls says. “Scouts for Equality is honored to be a part of the movement that has achieved a tremendous victory towards the fight for equality in America and we are proud to call ourselves Scouts.”

The new resolution does not permit gay staff or scout leaders in the organization. That still separates the Boy Scouts from other leading youth development organizations, like the Girl Scouts, 4-H clubs, and the Boys and Girls Clubs of America — all of which already allow both gay youth and staff. Scouts for Equality and GLAAD plan to continue their fight to overturn that portion of the ban next.

“Today’s vote is a significant victory for gay youth across the nation and a clear indication that the Boy Scouts ban on gay adult leaders will also inevitably end,” says Rich Ferraro, GLAAD vice president of communications. “America heard from religious leaders, corporate sponsors and so many Scouting families who want an end to discrimination against gay people.”

Mormon support for the ban’s repeal likely played a crucial role in the outcome. The Church of Jesus Christ of Latter-day Saints announced its support for the resolution last month, and over 45% of BSA chartered units are LDS, as well as two of the “Key Three” BSA leaders, including Perry. Ross Murray, who runs GLAAD’s faith outreach, says he suspects that LDS church is seeking to change its image after the Prop 8 campaign. “The Mormon Church’s endorsement for dropping the ban on gay Scouts matches the shifting attitude from within the Mormon Church,” he explains. “Increased acceptance of gay and lesbian people in society means the Mormon Church is working to keep up with that change, even while they have limits on participation and leadership.”

Supporters of the ban on gays, including the Family Research Council and OnMyHonor.net, say the decision signals that Americans religious liberties are under attack. “Sadly, the Boy Scouts’ legacy of producing great leaders has become yet another casualty of moral compromise,” FRC president Tony Perkins said in a statement that called the BSA national leadership’s efforts on the resolution “manipulative” and “strong-armed.” Perkins says the fight is not over: “We will stand with those BSA Councils who will now act to protect boys from a new policy that only creates moral confusion and disrespects the views of the vast majority of Scouting parents.”

The anonymous gay BSA employee who wrote an op-ed for TIME this week issued a statement praising the decision. “Tonight I am heartened to know the Boy Scouts is on its way toward becoming a more welcoming, inclusive organization that allows viewpoints from people of all faiths,” he said.

The new membership policy goes into effect Jan. 1.

PHOTOS: Boy Scouts of America Turns 100

INTERACTIVE: Timeline of the Gay Rights Movement in the U.S.