(Brennan Linsley/AP Photo)

WASHINGTON - Former President Bill Clinton warned Saturday night that despite great gains for the gay and transgender community, the lines of gender and race in politics could still cast a shadow in the years ahead.

Clinton was the keynote speaker at the Human Rights Campaign's annual black tie dinner Saturday night. And as Hillary Clinton continues to lay the groundwork for a possible presidential run of her own, the leading lobby for gay and transgender rights represents a strong Democratic constituency profoundly affected - both positively and negatively - by his time in the Oval Office.

"I believe that in ways large and small, peaceful and sometimes violent, that the biggest threat to the future of our children and grandchildren is the poison of identity politics that preaches that our differences are far more important than our common humanity," he told the crowd of activists, celebrities, and lawmakers.

The head of the Human Rights Campaign is himself a former veteran of the Clinton White House.

Buoyed by recent legislative victories for their cause, the HRC has been trying to expand its focus into formerly unreachable areas, including the rural and religiously conservative Deep South, and overseas.

Clinton, recollecting the Human Genome Project of his administration, had this advice for the volunteers heading into new territory: "When the HRC goes to Arkansas, Mississippi, and Alabama, and you see the first person who cusses you out, just remember we're 99 and a half percent the same."

Clinton also noted that at his recent high school reunion - he attends every year - he learned a close childhood friend had finally wed their partner.

The president's years in office were not completely rosy ones for the gay community - stymied by the creation of the now-defunct "don't ask, don't tell" policy in the military, and his signing of the Defense of Marriage Act. That signing was politically expedient at the time, because the law passed Congress with wide enough margins to overcome a presidential veto. Facing reelection, Clinton also feared losing the right-leaning rural Americans that had helped propel the former Arkansas governor into office.

Clinton spent 17 years first defending, then inching away from the decision. His evolving position came full circle last year, when in an editorial published in the Washington Post, the man who signed the Defense of Marriage Act called for its overturn in the Supreme Court.

Should Hillary Clinton run for president, that reluctant history is likely to provide ammunition to a challenger from the left.

Outgoing Attorney General Eric Holder also spoke briefly in a surprise visit to the dinner. Holder, who will leave behind a reputation of civil rights activism in office, trumpeted the Justice Department's announcement Saturday that the agency would expand recognition of same-gender marriage licenses to an additional six states, bring the total of those recognized by the Obama administration to 32.