After a canine custody battle sparked outrage on social media, Rosemary the dog was reunited with her original owner Alec Nygard on Friday afternoon.

Rosemary, a 3.5-pound Chihuahua mix, escaped from Nygard’s Cameron Park home on April 4. Later that day, she was brought in to Sacramento County’s Bradshaw Animal Shelter.

Without identification tags or a microchip, the shelter held Rosemary for a mandatory 72-hour period. On April 8, Rosemary, renamed Nala, was legally adopted and signed over to a new family. That night, Nygard learned she was at the shelter, and the next day, he went to retrieve his beloved pooch.

“She said essentially there was nothing I could do, she wasn’t my property anymore, and I was too late essentially,” said Nygard on Wednesday, recounting his conversation with shelter staff.

But Rosemary was still at the shelter waiting to be picked up by her new owner when Nygard arrived on April 9, leading to cell phone video of the dog excitedly jumping up and down, behind glass, trying to get to Nygard. That video broke hearts on social media, with many people demanding that the anonymous new owner return Rosemary to Nygard.

But Nygard also attracted his fair share of criticism from people who argued that the dog should have been microchipped and needed a collar with ID tags. Nygard originally told the shelter he didn’t believe in microchipping.

Had Rosemary come in with either form of identification, she would have been held for 10 days before being put up for adoption.

The online conversation and debate continued to grow, though, and on Thursday night, Nygard got a call from Rosemary’s adopter.

“The conversation we had was really about the welfare of Rosemary. That’s what we care most about – making sure Rosemary is happy and safe,”said Nygard.

The adopter told him to return to Bradshaw on Friday, and in the early afternoon – after days apart – Rosemary and Nygard were reunited. Rosemary, for her part, couldn’t stop licking her owner’s face.

“Rosemary’s happy, so we’re all happy,” said Nygard.

Shelter director Dave Dickinson said the shelter will move forward in changing its policy to prevent similar situations from occurring again. Once the changes are finalized, adoption fees will be held as deposits until the animal actually leaves the shelter with the adopter.

If the original owner comes to claim the dog before the animal is picked up, the shelter will retain the right to refund the deposit and reunite the pet with the original owner.