James C. Hormel, who became the first openly gay U.S. ambassador in 1999 after his nomination was blocked for nearly two years by conservative senators, triggering a long political battle over gay rights, presidential nominations and Senate procedures, died Aug. 13 at a San Francisco hospital. He was 88.

The death was announced by Human Rights Campaign, the gay rights advocacy organization that Mr. Hormel helped found in the early 1980s. The cause was not disclosed.

Mr. Hormel, a grandson of the founder of the Hormel meatpacking and food company, spent most of his life as a law school dean, philanthropist, a supporter of gay rights groups and a contributor to the Democratic Party. His largesse led to his nomination in 1997 by President Bill Clinton to be ambassador to the tiny European country of Luxembourg. The Senate Foreign Relations Committee approved Mr. Hormel on a 16-to-2 vote, and he seemed all but sure to be confirmed by the full Senate.

He was already in a training program at the State Department when he learned that three senators, all Republicans, placed a “hold” on his nomination: Tim Hutchinson of Arkansas, James M. Inhofe of Oklahoma and Robert C. Smith of New Hampshire.

Mr. Hormel’s qualifications were not at issue: He had been a dean at the University of Chicago law school, had directed a family investment firm and had served on many civic boards. But under Senate rules, any member could block a nomination from going forward to a full vote. The three senators, later joined by others, opposed Mr. Hormel for what they called his support of a “gay agenda.”

“This is not a tolerance issue,” Smith said. “This is a matter of advocacy of the gay lifestyle.”

Inhofe likened Mr. Hormel to David Duke, a onetime member of the Ku Klux Klan who softened his public image to run for office. Other Republican senators also joined in, including Majority Leader Trent Lott (Miss.), who aired his views of gay people on a conservative TV talk show and said: “You should try to show them a way to deal with that problem, just like alcohol . . . or sex addiction . . . or kleptomaniacs.”

A film clip of Mr. Hormel at a San Francisco gay pride parade appeared to show him laughing at a group of men, dubbed the Sisters of Perpetual Indulgence, marching while wearing nun’s habits. Lott’s spokesman said, “Senator Lott opposes the naming of someone who has supported an extremist, anti-Catholic group to represent the United States.”

Echoing the talking points of groups such as the Family Research Council and the Traditional Values Coalition, some senators cited Mr. Hormel’s $500,000 donation to the San Francisco Public Library, which used the funds to create one of the world’s largest repositories of gay and lesbian literature. Activists opposed to his nomination discovered that the center’s collection — which was not selected by Mr. Hormel — included pornography and journals related to pedophilia.

“Hormel is a purveyor of smut,” the executive director of the Traditional Values Coalition declared. “Being pro-pedophilia and pro-incest may be the community standard in San Francisco, but it is not the community standard in America.”

Members of Mr. Hormel’s family came to his defense. New York Times columnist Frank Rich printed parts of a letter written to Lott by Mr. Hormel’s former wife, Alice, with whom he had five children.

“I gather his personal ethics have been questioned,” she wrote. “If anyone on this earth could come close to judging that, it would be me. . . . This is a good man. Give him a chance.”

Mr. Hormel’s son, Jimmy, who managed the family investment firm with his father, wrote: “Those who oppose my father’s nomination on the premise that sexual orientation affects ‘family values’ are not familiar with the strength of our family. While I was growing up, my father never tried to influence my sexuality in any way. What he did teach me was kindness, acceptance of others, honesty, self-esteem, and standing up for what you believe.”

Mr. Hormel’s nomination appeared to be dead in 1998, after Lott did not advance it to the full Senate for a vote. A year later, Clinton renominated Mr. Hormel for the vacant ambassadorship. While the Senate was in recess for the Memorial Day holiday, Clinton installed him in the post through a procedural move that did not require Senate approval.

Many conservatives were outraged.

“I think that by forcing Americans to be represented by a radical homosexual activist like Hormel, Clinton is showing his contempt for traditional morality, marriage, sexual fidelity and any concept of honor,” a spokesman for the Family Research Council said. “Who’s he going to appoint next? Larry Flynt as ambassador to the Vatican?”

Inhofe called Mr. Hormel “an inappropriate representative of our country” and vowed, along with Lott and other Republicans, to block or delay other Clinton appointments. That plan fell apart after it was revealed that members of Inhofe’s Senate staff had downloaded so much pornography that they almost crashed the office computer system.

Mr. Hormel, in the meantime, took his oath of office in late June 1999 and served without incident as ambassador to Luxembourg until December 2000.

“The process was very long and strenuous, arduous, insulting, full of misleading statements, full of lies, full of deceit, full of antagonism,” Mr. Hormel said in 2012 while promoting a memoir, “Fit to Serve,” written with Erin Martin.

“Ultimately a great deal was achieved,” he added. “Ultimately, regulations were changed in the State Department. Ultimately, other openly gay individuals were appointed without the rancor that went into my case.”

James Catherwood Hormel was born Jan. 1, 1933, in Austin, Minn. His grandfather had founded the Hormel food company in 1891, and his father was chief executive. In 1937, Hormel began to market Spam, a canned meat product that became popular during World War II.

Mr. Hormel, the youngest of three sons, grew up in a mansion surrounded by servants, chauffeurs and musical instruments, which he became skilled at playing.

He graduated in 1955 from Swarthmore College in Pennsylvania and received a law degree in 1958 from the University of Chicago. He served as the law school’s dean of students from 1961 to 1967.

In 1965, Mr. Hormel and his wife, the former Alice Parker, were divorced after they both realized he was gay. He settled in San Francisco in the mid-1970s and founded a company to manage the Hormel family’s investments and philanthropic contributions.

He routinely gave away a quarter of his annual income to support hunger relief, AIDS research, educational programs and other charitable projects. He helped launch the Human Rights Campaign, now the country’s largest advocacy group for LGBTQ rights, and served on the boards of the San Francisco Chamber of Commerce and San Francisco Symphony, among other organizations.

Mr. Hormel had long relationships with artist Larry Soule and lawyer Timothy Wu before marrying Michael P.N. Araque in 2014. Their marriage was officiated by Rep. Nancy Pelosi (D-Calif.), who was House minority leader at the time. Besides his husband, survivors include his five children, 14 grandchildren and seven great-grandchildren.

Pelosi, Bill and Hillary Clinton and Sen. Dianne Feinstein (D-Calif.) were among those issuing statements of tribute after Mr. Hormel’s death.

“This is one of those glorious days when the nice guy finishes first,” Secretary of State Madeleine Albright said in 1999, when Mr. Hormel was sworn in as ambassador. “Neither race, nor creed, nor gender nor sexual orientation should be relevant to the selection of ambassadors for the United States.”