"Sweet D", with his "fur grandma" Kelly Melvin, sports a bumper sticker on his back in support of Buddy during the Rally to Return Buddy Home and Reform ACS Practices in Alamo Plaza on Saturday, Jan. 18, 2014.

Photo By Lisa Krantz/SAN ANTONIO EXPRESS-NEWS

Buddy supporters arrive back in Alamo Plaza after riding a City Sightseeing Double Decker Tours bus, taking the Rally to Return Buddy Home and Reform ACS Practices mobile, in San Antonio on Saturday, Jan. 18, 2014. At right is Belle Hoover, 12.

Photo By Lisa Krantz/SAN ANTONIO EXPRESS-NEWS

Schroeder, right, with owner Laurie Malchow, and Okie, who was rescued in Oklahoma, entertain each other during the Rally to Return Buddy Home and Reform ACS Practices in Alamo Plaza on Saturday, Jan. 18, 2014.

Photo By Lisa Krantz/SAN ANTONIO EXPRESS-NEWS

Maddie, a nine-year-old pit bull and cancer survivor, center, attends the Rally to Return Buddy Home and Reform ACS Practices in Alamo Plaza on Saturday, Jan. 18, 2014. Maddie attended the rally with her human siblings, Jim Graham and Nancy York, since their mom and Maddie's owner is 93 years old.

Photo By Lisa Krantz/SAN ANTONIO EXPRESS-NEWS

Buddy supporters ride a City Sightseeing Double Decker Tours bus as they take the Rally to Return Buddy Home and Reform ACS Practices mobile in downtown San Antonio on Saturday, Jan. 18, 2014.

Mommy, a rescued dog, sits in the lap of owner Mike Lebo during the Rally to Return Buddy Home and Reform ACS Practices in Alamo Plaza on Saturday, Jan. 18, 2014. Lebo and his fiancŽe, Laura Jamin, have 10 other rescued dogs at home.

SAN ANTONIO — Nearly three months after being confined to a kennel at Brooks City-Base, Buddy the Dog soon will be released to his owners.

The city on Tuesday reached an agreement with the attorneys for the dog's owners, effectively vacating a Dec. 11 ruling by Municipal Court Judge Daniel Guerrero that the brown-and-white golden-retriever mix be euthanized for attacking a 9-year-old girl in the parking lot of a Northwest Side apartment complex.

The agreement places several conditions on the dog's owners: Homer Mojica — an 83-year-old retiree who doted on Buddy over the past six years — and his wife, Kathryn.

The settlement requires the Mojicas to muzzle the dog and keep him on a leash no longer than 6 feet when he's in public, and to keep him within a “secure enclosure” (such as their apartment) when he's not on a leash. They also will have him microchipped and photographed for identification purposes, and must maintain liability insurance of $100,000 as long as they own the dog. The Mojicas also agreed to attend a class on responsible pet ownership.

Despite the conditions imposed by the city, the settlement was a major victory for the Mojicas and the animal-rights activists who rallied to their cause in recent weeks.

Last week, with public interest in the case building, the city released Buddy to the Mojicas' veterinarian.

Hector Mojica described Buddy as mild-mannered dog with no history of aggression, and said the attack — which resulted in a cut to the girl's lower lip, a gash on her right cheek, and a deep scratch across her lower right eyelid — happened after the girl screamed at the dog and startled him. The girl's mother testified in Municipal Court that the attack was unprovoked.

Michelle Maloney, lead attorney for the Mojicas, indicated Buddy's return to his owners is imminent.