F. Allen “Tex” Harris, a U.S. diplomat who had a key role in exposing human rights abuses in Argentina in the late 1970s, when thousands of people were imprisoned and killed by the country’s military junta, died Feb. 23 at a hospital in Fairfax County, Va. He was 81.

His son Clark Harris confirmed the death, adding that the cause has not been determined and that an autopsy is being conducted.

Mr. Harris was a 6-foot-7-inch Texan who was assigned to the U.S. Embassy in Buenos Aires in 1977, soon after Jimmy Carter became president and made human rights a cornerstone of his foreign policy.

At the time, Argentina was controlled by a group of military leaders who seized control of the government in 1976 after the chaotic two-year presidency of Isabel Perón. The United States initially applauded the country’s military leaders and the stability they seemed to represent, but Mr. Harris soon learned of widespread efforts by the government to stifle dissent, often through kidnappings and killings.

“As many people as necessary must die in Argentina so that the country will again be secure,” said Gen. Jorge Videla, the country’s president from 1976 to 1981.

Mr. Harris began to take action soon after learning that 17 members of a Catholic church and their priest had disappeared after speaking out against the actions of the government.

“That was the big eye opener,” he told the Wall Street Journal in 2016. “We began to develop a very clear picture of who was being targeted and they were not terrorists.”

The people who vanished, many of them in their teens and 20s, were dubbed los desaparecidos — the disappeared. That period of terror, which lasted from 1976 until the military government ceded power in 1983, became known as Argentina’s “dirty war.”

“This was not an ad hoc, spur-of-the-moment vigilante group,” Mr. Harris told Bill Moyers in a 1984 television interview, “but was a concerted program of the military government to eliminate entire groups of people that they deemed to be subversives in their society. There were thousands of people who disappeared without a trace, without a murmur, just a picture on their mother’s dresser.”

Mr. Harris printed up business cards and went to Buenos Aires’s central square, Plaza de Mayo, where he handed them out, particularly to victims’ mothers. He encouraged families of the disappeared to visit him at the U.S. Embassy.

“What I did in Argentina was to open the doors and, for the first time, to talk to the people,” he told Moyers.

He compiled thousands of note cards documenting cases of disappearance, torture and death, reporting to the State Department that Argentina’s military leaders had “a clear intention to exterminate” anyone who opposed them. Even children and babies were seized from parents deemed to be dissidents.

“There was no due process,” Mr. Harris said. “There were no trials. There were no appeals.”

From 1977 to 1979, Argentina’s Foreign Ministry noted this week, Mr. Harris filed 13,500 complaints about human rights violations. He and his family came under threat from Argentine authorities and militia groups.

Despite the Carter administration’s emphasis on human rights, Mr. Harris found little support in the upper echelons of the State Department, including from the U.S. ambassador to Argentina at the time, Raul Hector Castro.

“I had many fights at the embassy,” Mr. Harris later said. “There were many people who wanted to have good relations with the military.”

He began sending his reports to Washington through the “dissent channel,” a rarely used form of communication for Foreign Service whistleblowers whose findings were being ignored or quashed. Patricia Derian, Carter’s human rights chief at the State Department, acted on Mr. Harris’s warnings by flying to Argentina to confront the country’s military leaders.

“I know people are being tortured right here under this roof,” she told the country’s chief naval officer in 1977. “In fact somebody’s probably being tortured right under our feet right now.”

Despite reductions in military aid and other sanctions against the Argentine government, the disappearances and killings did not stop. When Mr. Harris was transferred out of Argentina in 1979, the country’s military elite reportedly raised toasts to his departure.

Mr. Harris’s State Department bosses almost drummed him out of the diplomatic corps, and he did not receive a promotion until after he was showcased on Moyers’s broadcast and was honored in 1984 with the American Foreign Service Association’s William R. Rivkin Award, for his “bureaucratic courage to stand up for what was right.”

“The embassy’s leadership tried to curtail my human rights reports,” Mr. Harris told the Buenos Aires Herald, leading to “a confrontation with my sense of duty to report the information being provided to me by family members and my responsibilities as a professional diplomat. And I was penalized for not being a ‘team player.’ For seven years, my career was paralyzed.”

After Argentina was defeated by Britain in the Falklands War of 1982, the country’s military junta began to lose its grip on power. In the years afterward, many of its leaders were sentenced to prison. The number of people killed during their seven-year reign is estimated to be at least 14,000.

“Tex risked his career and his life to tell Washington and the world what was happening,” Robert Cox, the onetime editor of the Buenos Aires Herald told the Houston Chronicle in 2013. “His decision to take a stand . . . saved lives and eventually led to the downfall of the dictatorship.”

Franklyn Allen Harris was born May 13, 1938, in Glendale, Calif., and grew up in Dallas, where he was an all-state basketball player in high school. His father was a businessman, and his mother had been a model and sales clerk.

After graduating from Princeton University in 1960, Mr. Harris used the money intended for a car purchase to travel around the world for almost three years, meeting a number of diplomats in his journeys. After graduating from law school at the University of Texas, he joined the State Department in late 1965.

Among other assignments, he served on task forces in the 1970s and ’80s that warned of long-term diplomatic dangers associated with climate change and the environment. When his career was resurrected in the late 1980s, he served in South Africa during the final years of apartheid and helped with efforts to limit the spread of AIDS in Africa. He also served at various times in Venezuela and Australia before retiring from the State Department in 1999.

Mr. Harris was a longtime force in the American Foreign Service Association, an advocacy organization for State Department officials, and served two times as its president. In 2000, the association named an award “for constructive dissent” in his honor. In recent years, Mr. Harris spoke out about climate change and the importance of using diplomacy to solve the world’s problems.

“Secretary of State Colin Powell had it right,” he said in a 2016 interview with the Foreign Policy Association. “He said that American diplomats are the first line of defense for this country. We are out there everywhere, with no body armor, no sidearms, no weaponry, and we are in every place protecting U.S. interests and U.S. citizens. That’s a critical job.”

Survivors include his wife of 53 years, the former Jeanie Roeder, of McLean, Va.; three children, Scott Harris of McLean, Julie Harris of Falls Church, Va., and Clark Harris of Los Angeles; and two grandsons.

Despite almost having his career derailed, Mr. Harris became something a legend among mid-level diplomats for his integrity and devotion to duty. In 1993, he received the State Department’s highest honor, the Distinguished Honor Award, for his work in Argentina, and he was presented Argentina’s top civilian honor in 2004. He also received an award in 2013 from the D.C. branch of the United Nations Assocation for “the use of diplomacy to advance human rights.”

Describing himself that year as “a joyful contrarian,” Mr. Harris said, “I made a career out of being a pain. My mother always said speak out and help people. It’s just the way I’m wired.”