(Monmouth University)

Tom Gallagher, the pioneering diplomat turned LGBT rights activist, has died aged 77.

The activist, the first openly out Foreign Service Officer, died on Sunday in Wall Township, New Jersey.

His husband Amin Dulkumoni told the New York Times it was a result of a heart condition and a staph infection.

Gallagher joined the Peace Corps immediately after graduating from Monmouth University in 1962 and went on to enjoy a trail-blazing career at the State Department.

He rubbed shoulders with some of the world’s most influential people but also volunteered as a social worker with trans sex-workers and AIDS patients in rundown areas of Washington and San Francisco.

He regularly remarked that as a Foreign Service Officer, countries where he worked might have imprisoned him if they learned that he was gay.

He said in an interview with his alma mater: “My life has been spent in the Tenderloin in San Francisco and some really wretched slums and dreadfully impoverished places in Africa, and I’ve hobnobbed with the King of Norway, the Queen of Spain, and five presidents who invited me to the White House— and I loved that too, every minute of it.”

The two worlds – of State Department work, and LGBT-rights activism – thrilled him, he added.

Despite being the first openly gay federal employee, he was not always open about his sexuality because of the strict social pressures of the time.

He fooled around with boys on the beaches of New Jersey as an adolescent, but remained convinced at the time that “the right woman” would cure his “bad thoughts.”

A psychology professor at college told him that homosexuality was an illness, avocating frontal lobotomy as a cure.

Gallagher later met the same professor in a gay cruising spot, where they pretended they did not know each other.

He said: “I was totally closeted. I was actually married in Saudi Arabia and Ethiopia. I thought it was a secret that I could keep forever.”

But working in San Francisco during era of gay liberation following the Stonewall Riots in 1968 made Gallagher feel more comfortable with his sexuality.

On returning to Washington, he decided he had to speak out about his sexuality – but the resulting backlash from the State Department meant he had to resign his position.

For twenty years, he was a social worker, particularly helping people who had AIDS.

He finally returned to the State Department in 1994, after a Government directive ended the policy of firing employees if they were gay.

But the anti-LGBT sentiment was still lingering in the service – on his return he was ignored by several former friends because of his activism.

Gallagher was celebrated by Hillary Clinton for his contributions to LGBT rights who said at a 2012 event: “I don’t want any of you who are a lot younger ever to take for granted what it took for people like Tom Gallagher to pave the way for all of you.”

“All of the employees who sacrificed their right to be who they were,” added Clinton, “were really defending your rights and the rights and freedoms of others.”

In retirement, he undertook occasional assignments for the Foreign Service, but never stopped advocating for LGBT rights.

“The fight is not over,” Gallagher said in an interview after retiring, “we still have a long way to go.”