Fred Phelps, 84, whose Westboro Baptist Church of Topeka, Kansas became the headquarters of a small but very loud anti-gay cult, died last week - probably without realizing that his conduct had made him one of the nation's leading advocates for gay rights.

Before he was excommunicated from his church last year for reasons that have not been explained, Mr. Phelps used his First Amendment rights to trample basic civic standards for human decency. Bearing placards proclaiming that "God hates" this or that, especially gays, Mr. Phelps and his followers long had imposed their hateful viewpoint upon others.

His efforts reached their nadir when his hateful horde began appearing at the funerals of soldiers who had been killed in Iraq or Afghanistan, characterizing their deaths as God's punishment for America's supposed sins.

The net effect of Mr. Phelps' hateful advocacy was to create sympathy, among reasonable people, for the gay rights movement. It's not coincidental that the period of his most active and most virulently hateful conduct coincided with the greatest advances in gay rights.

His conduct was such that even responsible religious leaders found it more difficult to advocate against the trend toward gay marriage.

"The world lost someone who did a whole lot more for the LGBT community than we realize or understand," said Cathy Renna, a longtime consultant to LGBT groups. "He has brought along allies who are horrified by the hate. So his legacy will be exactly the opposite of what he dreamed."