Robert E. White, former U.S. ambassador to El Salvador, was removed from his post by the Reagan administration in 1981. (Reuters)

In 1980, when El Salvador was erupting in guerrilla war and military violence, the Carter administration sent a little-known Foreign Service officer into the maelstrom as its new ambassador, hoping he could help the U.S.-backed government there find a reformist middle ground and prevent a full-scale revolution.

Instead, Robert E. White became a controversial and outspoken critic of assassinations and massacres being carried out by American-trained military units and private right-wing death squads. His views cost him his diplomatic career but earned him the respect of many Salvadorans and, ultimately, the vindication of history.

Mr. White, who had previously served as U.S. ambassador to Paraguay, died Jan. 14 at a hospice in Arlington, Va. He was 88. The cause was bladder and prostate cancer, said a daughter, Claire White.

His brief tenure in San Salvador was marked by atrocities that became synonymous with right-wing violence during an era of ideological conflicts in Central America: the assassination of Catholic Archbishop Óscar Romero in March 1980 while he was saying Mass in the national cathedral, and the abduction and killing that December of four American women church workers: Maryknoll sisters Ita Ford and Maura Clark, Ursuline Sister Dorothy Kazel and lay missioner Jean Donovan.

Mr. White, who once said he was inspired to join the Foreign Service by a “quotient of idealism,” worked to promote human rights, economic reforms and political negotiations between leftist rebels and El Salvador’s civil-military junta. But he soon found himself at loggerheads with the rightist military and land-owning establishment, which had powerful allies in Washington and Miami.

Unable to keep silent as security abuses mounted, Mr. White began denouncing them in diplomatic cables, then in interviews and congressional testimony. He famously called rightist political leader Roberto D’Aubuisson a “pathological killer” and charged that he had orchestrated the execution of Romero.

Mr. White also accused the Salvadoran national guard of murdering the Maryknoll women — two of whom he had dined with the night before their disappearance. He was there when the women’s bodies were dug up, and he was quoted as vowing angrily, “This time the bastards won’t get away with it.”

“Bob was transformed by those events, especially the killings of the Maryknolls, from a diplomatic functionary into a person whose ethical and moral convictions conflicted with his job,” said Francisco Altschul, the current Salvadoran ambassador to the United States, who was a leftist political activist at the time. “It took a lot of courage and integrity to say what he did and to face the consequences.”

Mr. White’s outspoken posture drew praise from human rights groups but death threats in El Salvador. His wife once described being warned by her security guard in their affluent San Salvador enclave that “your neighbors would like to kill you.”

The ambassador also faced strong opposition from powerful Washington hawks including Sen. Jesse Helms (R-N.C.), who had been annoyed with Mr. White’s earlier human rights activism in Paraguay and compared his posting to El Salvador to “a torch tossed in a pool of oil.”

By 1981, after the election of Ronald Reagan as president ushered in a new era of anti-communist fervor in Washington, Mr. White’s days as ambassador were numbered. After coming into conflict with Secretary of State Alexander M. Haig Jr., Mr. White was removed from his post less than two weeks after Reagan took office. He soon retired from the Foreign Service after a 25-year career, claiming that he had been forced out for political reasons.

“In El Salvador, Bob believed the authoritarian regime was morally repugnant and needed to change, but he worked very hard to avoid the escalation of war and negotiate a solution,” said William M. LeoGrande, a professor at American University and author of “Our Own Backyard: The United States in Central America, 1977-1992.”

“The tragedy was that U.S. policy changed, El Salvador became a Cold War proxy, and another decade of conflict followed,” LeoGrande said.

Once free of the constraints of diplomacy, Mr. White spent much of the next three decades speaking his mind on U.S. policy and official abuses in Latin America, while holding a series of jobs, including a professorship at Simmons College in Massachusetts and a senior associate position at the Carnegie Endowment for International Peace in Washington.

He was a sarcastic critic of Washington’s Cold War-era policies in Latin America, particularly what he called the “primitive anti-communism” that produced the U.S. embargo against Fidel Castro’s Cuba and support for hemispheric dictators such as Gen. Augusto Pinochet in Chile and Gen. Alfredo Stroessner in Paraguay. He accused the Reagan administration in 1984 of covering up its knowledge of D’Aubuisson’s role in the Romero assassination. Administration officials denied the allegations.

In 1989, Mr. White was named president of the Center for International Policy, a liberal think tank in Washington, and held that position at the time of his death. He also visited numerous countries, from Haiti to Afghanistan, with delegations to monitor elections and human rights.

Robert Edward White was born Sept. 21, 1926, in Melrose, Mass. He served in the Navy as a radio operator in the Pacific during World War II. He attended Saint Michael’s College in Vermont on the G.I. Bill, graduating in 1952, and completed a master’s degree in 1954 at Tufts University’s Fletcher School in Medford, Mass.

He joined the Foreign Service in 1955 and served in a variety of positions related to Latin America. He was posted in Colombia, Ecuador, Honduras and Nicaragua, served as regional director of the Peace Corps and was a U.S. representative to the Organization of American States. He was ambassador to Paraguay from 1977 to 1980, when he was transferred to El Salvador.

Survivors include his wife of 59 years, Maryanne Cahill White of Alexandria, Va.; three children, Chris White of Manassas, Va., Claire White of Cambridge, Mass., and Mary Lou White of Evanston, Ill.; a brother, David White of Alexandria; and three grandchildren.

A son, Kevin White, died in 2009; a daughter, Laura White, died in 2014.

Mr. White always described himself as a diplomat and a democrat rather than a leftist or moral zealot.

“I don’t go out looking for windmills to joust,” he told an interviewer from Commonweal magazine in 2001. “And the idea that I’m some sort of martyr? Well, I’m not.”

He argued that to avoid ending up on the wrong side of history or in Vietnam-style military quagmires, the United States needed to seek negotiated solutions to all conflicts, maintain a moral component in its dealings with all regimes and respect the will of local populations.

“The military dictators of the world fear democracy more than anything else,” he told the Fletcher Forum, a publication of the Fletcher School of Law and Diplomacy, in 1981. “U.S. policy toward Latin America can be summed up in three words: fear of revolution. Because we feared revolution, we consistently opposed the forces of change while uncritically supporting dictatorships and small economic elites. We blinked at repression and participated in the perversion of democracy throughout the hemisphere.”

CORRECTION: An earlier version of this obituary incorrectly described all four American women abducted and killed in El Salvador in 1980 as Maryknoll church workers. Only two of the four women, Ita Ford and Maura Clark, were Maryknoll sisters. The third, Dorothy Kazel, was an Ursuline sister. The fourth, Jean Donovan, was a lay missioner. The obituary has been updated.