As he leaves the volunteer presidency of the Boy Scouts of America, Robert Gates says the organization is well-positioned for the future after deciding to allow openly gay adult leaders in its ranks.

The former U.S. secretary of defense ended his two-year term Thursday as volunteer president. He was replaced by AT&T CEO Randall Stephenson.

In remarks released by the Boy Scouts, Gates says he supported the policy change on openly gay adults after several local councils disregarded the previous ban and Scout groups in many states faced the prospect of discrimination lawsuits.

Churches can still use sexual orientation in deciding adult leaders.

Gates says that "difficult decision" has allowed the Boy Scouts to "look to the future" and come close to reversing years of decline in Scouting membership.