Robert M. Gates, the former secretary of defense and director of the CIA, was elected president of the Boy Scouts of America on Thursday, formally taking leadership of an organization that continues to be roiled by its policy on gay Scouts and leaders.

Gates, 70, who has also been president of Texas A&M University, is the rare Scout leader to have a national reputation before being elected, which could become important as pressure on the group persists from corporations, religious groups and advocates for equal rights.

While serving as defense secretary, he supported the 2010 repeal of the “don’t ask, don’t tell’’ policy on gay men and lesbians serving openly in the military.

Gates created a stir this year in his autobiography, when he was critical of President Barack Obama. He said that while his former boss was supportive of the nation’s military, the president did not appear to be entirely supportive of the war effort in Afghanistan.

Gates, an Eagle Scout, had been serving as the Boy Scouts’ president-elect since his approval by the national executive board in October. On Thursday, he was formally elected by the organization’s national council at its annual meeting in Nashville, Tennessee.

Gates is taking the helm of an organization that has experienced a decline in membership for years as it seeks new ways to compete for the attention of boys in a culture far removed from the one Gates grew up in during the 1950s in Wichita, Kan.

“The Boy Scouts of America had a profound influence on my childhood and helped form the foundation of my career in public service,” Gates said in a statement. “I’ve had tremendous opportunities in my life, but I can say without hesitation that my memories of Scouting are every bit as vivid and meaningful as what came later. I believe every boy deserves an opportunity to experience what Scouting offers.”

Since last May, when the Boy Scouts’ national board voted to allow openly gay children to become Scouts but to continue to bar openly gay adults age 18 and over from leadership positions, the group has been criticized by some for having gone too far, and by others for not going far enough. (The policy went into effect Jan. 1.)

Some groups, including the Southern Baptist Convention, have condemned the Boy Scouts for admitting gay youths.

But several companies, including Disney and Merck, have announced in recent months that they plan to cut off funding if the Scouts do not change the rule prohibiting gay adults.

This week, gay rights advocates submitted a petition to Amazon.com with about 125,000 signatures asking the company to remove the Boy Scouts from its list of charitable organizations.

Other groups said Thursday that they were encouraged by Gates’ history as defense secretary.

When he oversaw the repeal of the military’s “don’t ask, don’t tell” policy, Gates said that “a policy that requires people to lie about themselves somehow seems to be fundamentally flawed — we couldn’t agree more,” said Zach Wahls, executive director of Scouts for Equality, a group composed largely of former Scoutsseeking to overturn the ban. “And even if some of the membership of a group might disagree, it is his role to lead and to chart a path forward. He did that in the military, and I hope he will do it here.”

Rich Ferraro, a spokesman for the gay rights organization GLAAD, said that Gates was aware of the risks of continuing to forbid gays from Boy Scout leadership roles.

“If anyone knows that gay and lesbian people can strengthen an institution, it is Secretary Gates,” he said. “He saw that the military was left stronger and that all the doomsday fallacies didn’t come true.”

To post a comment, log into your chosen social network and then add your comment below. Your comments are subject to our Terms of Service and the privacy policy and terms of service of your social network. If you do not want to comment with a social network, please consider writing a letter to the editor.