Prince Andrew, the Duke of York and second son of Queen Elizabeth, was spotted making a public appearance at church Sunday with his mother a day after news broke that his friend, Jeffrey Epstein, died in jail.

Epstein was arrested in July and pleaded not guilty to charges of drug trafficking and sexually abusing dozens of underage girls in New York and Florida. He died early Saturday in a Manhattan jail in an apparent suicide while waiting trial on sex-trafficking charges.

Paparazzi photos obtained by British tabloids show Prince Andrew's oldest daughter, Princess Beatrice, accompanying her father and grandmother in a car after service at Crathie Kirk Church, where the royal family worships while in residence at Balmoral Castle in Scotland.

The charges against Epstein do not involve Andrew, although Virginia Roberts Giuffre, 35, has previously accused the wealthy financier and his employees of paying her, when she was 17, to sexually service him along with Prince Andrew, Harvard lawyer Alan Dershowitz and other friends of Epstein. Andrew forcefully denied her allegation.

According to British media reports, Epstein and Prince Andrew have been friends for more than two decades. Their relationship is often cited as evidence of Andrew's alleged poor judgment, and likely contributed in 2011 to the end of Andrew’s role as a British trade envoy, a job he had held for about 10 years.

The Guardian reports that Andrew met Epstein in the 1990s after being introduced by Ghislaine Maxwell, daughter of the late British media mogul Robert Maxwell. She was Epstein's girlfriend and employee at the time and has been implicated in Epstein's alleged trafficking activities as one of his supposed "recruiters."

What's their link? Jeffrey Epstein's friendship with Prince Andrew is raising eyebrows

In 2011, Andrew's ex-wife, Sarah Ferguson, Duchess of York, to whom he is still close, acknowledged that Epstein had loaned her money to pay off her debts during one of her past financial crises.

According to The Telegraph, she apologized for a "gigantic error of judgment."

"I personally, on behalf of myself, deeply regret that Jeffrey Epstein became involved in any way with me. I abhor pedophilia and any sexual abuse of children and know that this was a gigantic error of judgment on my behalf," she said in a statement at the time.

Contributing: Maria Puente and Olivia Sanchez, USA TODAY

More on Epstein:Jeffrey Epstein was awaiting trial on sex-trafficking charges