President Obama is not the only politician evolving on gay rights.

Virginia Gov. Robert F. McDonnell (R) speaks to the Conservative Political Action Conference in Washington on Feb. 10. (Chip Somodevilla)

It came on the occasion of the General Assembly’s vote Tuesday to block the appointment of a gay Richmond prosecutor, Tracy Thorne-Begland, to the bench in Richmond.

That’s the same Robert F. McDonnell who in 2003, as a delegate and chairman of the House Courts of Justice Committee, led a successful effort to unseat Verbena M. Askew, a Circuit Court judge from Newport News.

It had come to light that two years earlier, Askew had been accused of sexual harassment by a female court worker. The woman, a Hampton city employee who also alleged that her supervisor and other employees had retaliated against her for making the complaint, received a $64,000 settlement from the city.

At the time, McDonnell said he opposed Askew’s reappointment to a second eight-year term because she hadn’t disclosed, as required, that she had been party to a legal proceeding.

In a widely reported comment in January 2003 to the Daily Press of Newport News, McDonnell questioned whether someone who had engaged in oral or anal sex could serve as a judge because that would violate the state’s anti-sodomy statute.

“It certainly raise some questions about the qualifications to serve as a judge,” he said.

“There is certain homosexual conduct that is in violation of the law,” he added. “I’m not telling you I would disqualify a judge per se if he said he was gay. I'm talking about their actions.”

(An even more widely reported comment: When the reporter asked if McDonnell had ever violated the so-called “crimes against nature” law, he replied: “Not that I recall.”)

Conceding about a week later that his comments had been “inartful,” McDonnell sought to clarify his position. He said that homosexuality was “not an issue” for judicial appointments, but that violations of the law — and gay sex qualified as such in Virginia until the U.S. Supreme Court struck down anti-sodomy laws in June 2003 — would have to be taken into consideration. The upshot was akin to the Catholic Church’s position on homosexuality: It’s OK to be gay so long as you’re celibate.

“What I told [the reporter] is if there was evidence, proven evidence like a criminal conviction, of a violation of the law, any criminal law, those things would need to be taken into consideration to determine the fitness for reappointment,” he told the Virginian-Pilot in 2003. “Homosexuality is not an issue with regard to the qualifications of a judge. I imagine we have gay judges on the bench now. That’s not a material inquiry.”

McDonnell further clarified his stance this week, after conservatives in the House blocked Thorne-Begland’s appointment as a General District Court judge in Richmond. In response to inquiries from reporters, the governor issued a statement that walked a fine line between declaring himself opposed to anti-gay discrimination and contending that he does not know if that played a role in Tuesday’s vote.

“I have long made clear that discrimination on the basis of such factors as race, religion or sexual orientation is not acceptable in any judicial appointment process,” McDonnell said. “In my consideration of judicial candidates I only consider the individual’s ability to do the job well. If anyone voted against Mr. Thorne-Begland because of his sexual orientation, that would be very disappointing and unacceptable.”

McDonnell spokesman Tucker Martin said that’s always been the governor’s position.

“The Governor’s position has been consistent and unchanging,” Martin said via e-mail. “From 2003 to 2006 to 2009 to 2010 to today he has always said that sexual orientation should never be a factor in hiring or judicial appointments.”