The parents of Matthew Shepard, the gay Wyoming college student whose brutal murder led to changes in how the federal government defines hate crimes, delivered a pointed message to Attorney General William Barr: Don’t be a hypocrite and protect the rights of transgender people.

Judy and Dennis Shepard did so in a letter that was read Tuesday at a Justice Department ceremony to mark the 10th anniversary of a law named after Shepard and James Byrd Jr., a black man who was dragged to his death behind a pickup truck in Texas.

Judy and Dennis Shepard address a roundtable on hate crimes in Washington on Oct. 29, 2018. Jonathan Ernst / Reuters file

Their letter took Barr and the Trump administration to task for taking the side of employers in the ongoing battle over whether they can legally discriminate against gay and transgender workers.

“We find it interesting and hypocritical that he would invite us to this event commemorating a hate crime law named after our son and Mr. Byrd, while, at the same time, asking the Supreme Court to allow the legalized firing of transgender employees,” the Shepards stated in the letter.

“Mr. Barr, you cannot have it both ways,” the letter went on. “If you believe that employers should have the right to terminate transgender employees, just because they are transgender, then you believe they are lesser than and not worthy of protection.”

So in future, the Shepards wrote, “You need not invite us to future events at the Department of Justice that are billed as celebrating a law that protects these same individuals from hate crimes.”

“Either you believe in equality for all or you don’t,” they wrote. “We do not honor our son by kowtowing to hypocrisy.”

Neither Barr nor the Shepards were there when the letter was read out loud by Cynthia Deitle, program director for the Matthew Shepard Foundation. But sitting behind her was Eric Dreiband, who heads the Justice Department's civil rights division.

When Deitle finished reading, the audience rose to its feet and applauded.

In a news release that was sent out after the event, the Justice Department did not mention the Shepards’ criticism.

The Justice Department did not immediately respond to NBC News' request for comment.

Matthew Shepard was killed in 1998 by two men who picked him up at a bar and drove him to the outskirts of Laramie, Wyoming, where they tied him to a fence and beat him bloody. He was barely alive when he was found 18 hours later and died at a Colorado hospital Oct. 12, 1998.

His abductors were later arrested and are now serving life sentences.

Shepard’s death sparked nationwide outrage and eventually led to the passage in 2009 of the Matthew Shepard and James Byrd Jr. Hate Crimes Prevention Act, which President Barack Obama signed into law.

It was the first federal law to criminalize violence against members of the LGBTQ community.

In their letter, the Shepards said years of discrimination against gay people in all facets of life paved the way for their son’s death.

“To this day, we are unable to understand why he was murdered for being gay,” they wrote. “Being gay is not a choice.”

Follow NBC Out on Twitter, Facebook & Instagram