Matthew Shepard was savagely killed in Wyoming in 1998 at the age of 21 and went on to become a symbol of anti-gay violence in the US.

After being robbed by two men, he was repeatedly beaten and tied to a fence in near freezing conditions. A cyclist found him after 18 hours. Six days later he died.

His parents cremated the body and kept the ashes, worried that a final resting place would be vandalised. But now he will finally be laid to rest. The remains will be interred inside the crypt of Washington National Cathedral on 26 October, his family says.

How was Matthew Shepard murdered?

The University of Wyoming student was openly gay. On 7 October 1998, he was lured from a bar in the city of Laramie by two men, Aaron McKinney and Russell Henderson. They both confessed to telling Shepard they were gay and offering him a ride home with the intent to rob him.

They became angry when Shepard made a sexual advance, they said, and drove the student to an isolated area outside town. There, the attackers tied him to a wooden fence and repeatedly struck Shepard’s head with a handgun.

The cyclist who found him first mistook the student for a scarecrow. Shepard was taken a local hospital and then moved to a better facility in Fort Collins, Colorado. His skull was so badly fractured by the beating that doctors said surgery was not an option. He died on 12 October.

Henderson pleaded guilty to murder and kidnapping and sentenced to life in prison. McKinney was also given a life sentence after being found guilty.

What was the reaction to his killing?

The brutal attack caused national outrage and put the spotlight on the violence against the LGBT community. His mother, Judy, led the creation of the Matthew Shepard Foundation, which fights for gay rights.

In 2009, after years of debate, Congress expanded hate crime laws to include offences motivated by a victim’s sexual orientation. The bill, which carried Matthew Shepard’s name, was signed into law by President Barack Obama with Judy at his side.

Same-sex marriage was legalised in 2015.

Why is he being laid to rest only now?

Shepard’s funeral in Casper, Wyoming, was attended by crowds of mourners – but also by demonstrators. His family reportedly worried that any resting place could be targeted by anti-gay groups.

The ashes will be interred in the crypt of the Neo-Gothic cathedral in Washington, which is the seat of the Episcopal Church, the US branch of Anglicanism.

“We’ve given much thought to Matt’s final resting place, and we found the Washington National Cathedral is an ideal choice, as Matt loved the Episcopal Church and felt welcomed by his Church in Wyoming,” his mother said in a statement.

“It’s reassuring to know he now will rest in a sacred spot where folks can come to reflect on creating a safer, kinder world.”

Mariann Edgar Budde, bishop of the Episcopal Diocese of Washington, and Bishop Gene Robinson, the first openly gay bishop in the Episcopal Church, will preside over the service, which will be open to the public.

“If I know anything about God, it’s that God can bring something good out of something terrible. And movements need symbols,” Bishop Robinson told the Washington Post.

Some 200 people have been buried in the cathedral, including President Woodrow Wilson, author and activist Helen Keller and her teacher Anne Sullivan, and US Navy Admiral George Dewey