Prince Harry and Meghan, Duchess of Sussex have received an apology from a photo agency that allegedly used drones to take pictures of their son, Archie, a lawyer for the couple has said.

The pair took the X17 agency to court over the images, taken in Los Angeles while the couple were at home.

Their lawyer said Thursday that the agency has apologized and agreed to pay some of their legal costs, PA Media reported.

"Over the summer, the Duke and Duchess of Sussex took action against intrusive and illegal paparazzi photos taken of their family at a private residence," Michael Kump, of Kinsella Weitzman Iser Kump LLP, said in a statement to PA.

"Today, the agency responsible for those photos — X17 — apologised and agreed to a permanent injunction and reimbursement of a portion of legal fees.

"This is a successful outcome," he said. "All families have a right, protected by law, to feel safe and secure at home."

Harry last year accepted "substantial damages" and an apology from another picture agency that used a helicopter to take photos of the home he shared with Meghan.

In that case, Splash News chartered a helicopter to take images of the couple's private home in the Cotswolds region of England, which Buckingham Palace said put the pair's safety at risk. The couple were forced to leave their home after the photos were published in outlets including The Times newspaper, a royal source familiar with that case told CNN at the time.

CNN has contacted the Duke and Duchess' legal firm and the X17 agency for comment.