MANILA — President Rodrigo Duterte of the Philippines has pardoned an American Marine convicted of killing a transgender woman, just days after his office blocked a court order to free the service member, the Philippine foreign secretary said on Monday.
The decision to release the Marine, Lance Cpl. Joseph Scott Pemberton, angered both Philippine nationalist groups that oppose the country’s military agreements with the United States and advocates for gay and transgender rights who said Mr. Duterte had shown leniency toward a hate crime.
Lance Corporal Pemberton, then 20, was convicted of homicide in 2015 for the killing of Jennifer Laude, 26. He was sentenced to six to 12 years in prison — a term that was later reduced to 10 years — and has since been held at Camp Aguinaldo, the Philippine military headquarters in metropolitan Manila.
The foreign minister, Teodoro Locsin Jr., said on Twitter that to “do justice,” Mr. Duterte had granted an “absolute pardon,” effectively reducing the Marine’s sentence to time served.
Mr. Duterte defended his decision in a public address on Monday. “If there is a time when you are called upon to be fair, be fair,” he said.
Mr. Duterte’s spokesman, Harry Roque, said that Mr. Duterte had no intention of forgiving Lance Corporal Pemberton.
“The president has erased whatever punishment that Pemberton still faced,” Mr. Roque said. “What was never erased in the mind of the president is the conviction of Pemberton, who is a killer.”
Mr. Roque, who once served as counsel to Ms. Laude’s family, said that the president had taken the action in the interest of an “independent foreign policy where he is a friend to everyone, an enemy to none.”
The move could help mend relations with the United States after years in which Mr. Duterte has been gravitating toward China, despite Beijing’s increasingly hostile actions in the South China Sea, where the two countries have territorial disputes.
Renato Reyes Jr., of the nationalist group Bayan, said the pardon was clearly a political accommodation to the United States, which has been helping to check China’s rising aggression in the region.
“The absolute pardon comes months after Duterte reversed the early pronouncement of the termination of the V.F.A.,” Mr. Reyes said, referring to the Visiting Forces Agreement. “The Philippine president has restored the V.F.A. to please the Americans.”
“The U.S. government had its way again on this issue,” he added.
Last week, the Olongapo City Regional Trial Court granted an appeal from Lance Corporal Pemberton and directed the Bureau of Corrections to release him.
The court reasoned that he had served almost six years, including the time between his arrest and conviction, and that he had exceeded the 10 years when a “good conduct time allowance” was added. The Laude family has also received $100,000 in civil damages.
The Marine met Ms. Laude in a nightclub in Olongapo City, about 100 miles north of Manila, in October 2014 while he was in the Philippines for joint military exercises.
According to closed circuit television footage presented at his trial, they entered a hotel room together but the Marine left alone shortly after. Ms. Laude was found dead in the room by a hotel worker, who testified that she was slumped over the toilet, apparently with a broken neck.
UP Babaylan, a group representing the L.G.B.T. community in the Philippines and the region, harshly criticized Mr. Duterte for freeing “his fellow murderer, Pemberton.” It was alluding to the president’s antidrug war, which has left thousands of people dead since 2016.
“This is a direct attack not just on Jennifer and her family but to every trans person and every victim of corrupt and unequal justice system,” the group said.
Virginia Lacsa Suarez, a lawyer for Ms. Laude’s family, said the pardon made a mockery of judicial and legal systems in the Philippines.
“There is so much disrespect in the manner by which Jennifer was killed — reflective of the disrespect the U.S. has for the Philippines’ democracy and sovereignty,” she said.