Both sides can claim victories in a lawsuit against the LA Zoo over the treatment of Billy the elephant -- a beast the suit described as overweight, depressed and sexually frustrated.

Judge John L. Segal ruled Tuesday that Billy could remain at the LA Zoo elephant habitat, but only as long as zookeepers make changes that include instituting daily two-hour exercise periods, forbidding the use of electric shocks and tilling the habitat's soil so the ground is softer, reports the Los Angeles Times.

Aaron Leider, a real estate agent who filed the lawsuit, called the decision a win despite the fact that his suit called for Billy and the other elephants to be removed from the zoo and sent to an animal sanctuary. On his Facebook page, he wrote, "WE WON OUR LAWSUIT AGAINST THE LA ZOO!" Leider also pointed out that for the first time in history, a zoo has been ordered by a judge to improve the way it cares for its animals.

Despite ruling that Billy should stay at the zoo, Judge Segal unleashed 56 pages of scathing criticism about the ignorance of the zoo's staff. He also wrote that the trial proved life for the zoo's three elephants is "empty, purposeless, boring, and occasionally painful."

More from the opinion:

Their lives are supervised, managed, and controlled by zoo employees who appear to be in the dark about normal and abnormal behavior of elephants, in denial about the physical and emotional difficulties of the elephants they manage and whose lives they control, and under the misconception that the elephants prefer to live their lives in an exhibit with human companions rather than with other elephants. The elephants are hardly, as defendants contend, “thriving.”


Judge Segal also suggested that LA Zoo visitors could see that Billy and his elephant companions were clearly unhappy, negating the purpose of exhibiting wild animals for the public's education and entertainment. "The Elephants of Asia exhibit at the Los Angeles Zoo is not a happy place for elephants," wrote Segal. "Nor is it for members of the public who go to the zoo and recognize that the elephants are neither thriving, happy, nor content."

Still, the judge stopped short of calling for the closure of the habitat because it was inconclusive as to how much space captive elephants need to thrive, reports the San Gabriel Valley Tribune.

The LA Zoo sent this prepared statement to the Los Feliz Ledger:

We are pleased that the court did not agree with the plaintiff’s request to close the elephant exhibit at the Los Angeles Zoo... This case, which began before the new habitat was initiated, focused largely on out-dated information and animal care practices and does not reflect the animal care decisions that have been made in recent years to improve the elephant habitat at the Los Angles Zoo.

...

We respectfully disagree with the court’s opinion regarding the competency and validity of our elephant program ... As the people who provide the day to day care for these animals we are competent in what we do and dedicated to the well-being of our elephants.

Leider's 2007 lawsuit had alleged that the ground of Billy's habitat was too hard, causing the elephant to suffer from cracked toes and weary joints. The suit also claimed that for most of the year, Billy was frustrated over his heightened state of sexual arousal because he couldn't follow his instinct to search for mates (from 2007-2010, Billy was the only elephant at the zoo).

In reaction to his frustration, claimed the suit, Billy walked in circles and bobbed his head for hours -- something experts say is a sign of emotional turmoil.

Click through photos below of Billy and the LA Zoo's Elephants of Asia exhibit:

Loading Slideshow...
  • Billy, a 25-year-old male Asian elephant

    Billy, a 25-year-old male Asian elephant walks in the newly constructed 6-acre, 42 million USD Pachyderm Forest habitat at the gala opening of the new Elephants of Asia exhibit at the Los Angeles Zoo, December 15, 2010 in Los Angeles, California. The exhibit features Billy and new additions Tina and Jewel. AFP PHOTO / ROBYN BECK (Photo credit should read ROBYN BECK/AFP/Getty Images)

  • City Council To Vote On Fate Of Controversial Elephant Exhibit at L.A. Zoo

    LOS ANGELES, CA - JANUARY 28: Billy, the only elephant currently at the Los Angeles Zoo, is seen in his temporary exhibit after the Los Angeles City Council voted today to keep Billy at the zoo and continue construction of the $42 million Pachyderm Forest elephant exhibit on January 28, 2009 in Los Angeles, California. A parade of celebrities who oppose elephants in zoos fought to shut down the project and send Billy to a sanctuary facility, including Bob Barker, Cher, Lily Tomlin and Kevin Nealon. After the Pachyderm Forest was approved by the City Council in 2006, actor Robert Culp and real estate agent Aaron Leider sued the city to stop the project alleging that zoo officials abuse elephants but the lawsuit was thrown out by the Los Angeles Superior Court. When completed, the 3 1/2-acre Pachyderm Forest will house up to five Asian elephants and three of their offspring in an enclosure with a waterfall and two pools. (Photo by David McNew/Getty Images)

  • City Council To Vote On Fate Of Controversial Elephant Exhibit at L.A. Zoo

    LOS ANGELES, CA - JANUARY 28: Billy, the only elephant currently at the Los Angeles Zoo, is seen in his temporary exhibit after the Los Angeles City Council voted today to keep Billy at the zoo and continue construction of the $42 million Pachyderm Forest elephant exhibit on January 28, 2009 in Los Angeles, California. A parade of celebrities who oppose elephants in zoos fought to shut down the project and send Billy to a sanctuary facility, including Bob Barker, Cher, Lily Tomlin and Kevin Nealon. After the Pachyderm Forest was approved by the City Council in 2006, actor Robert Culp and real estate agent Aaron Leider sued the city to stop the project alleging that zoo officials abuse elephants but the lawsuit was thrown out by the Los Angeles Superior Court. When completed, the 3 1/2-acre Pachyderm Forest will house up to five Asian elephants and three of their offspring in an enclosure with a waterfall and two pools. (Photo by David McNew/Getty Images)

  • City Council To Vote On Fate Of Controversial Elephant Exhibit at L.A. Zoo

    LOS ANGELES, CA - JANUARY 28: Children watch Billy, the only elephant currently at the Los Angeles Zoo, in his temporary exhibit after the Los Angeles City Council voted today to keep Billy at the zoo and continue construction of the $42 million Pachyderm Forest elephant exhibit on January 28, 2009 in Los Angeles, California. A parade of celebrities who oppose elephants in zoos fought to shut down the project and send Billy to a sanctuary facility, including Bob Barker, Cher, Lily Tomlin and Kevin Nealon. After the Pachyderm Forest was approved by the City Council in 2006, actor Robert Culp and real estate agent Aaron Leider sued the city to stop the project alleging that zoo officials abuse elephants but the lawsuit was thrown out by the Los Angeles Superior Court. When completed, the 3 1/2-acre Pachyderm Forest will house up to five Asian elephants and three of their offspring in an enclosure with a waterfall and two pools. (Photo by David McNew/Getty Images)

  • Animal Activists Try To Remove Elephant From Los Angeles Zoo

    LOS ANGELES, CA - DECEMBER 13: Art student Mayuka Thais, who supports sending Ruby, a 45-year-old African elephant at the Los Angeles Zoo, to a sanctuary, sits next to her painting at a town hall meeting to discuss the conditions of elephants in captivity on December 13, 2006 in Los Angeles, California. The push to move Ruby to the PAWS sanctuary in San Andreas, California would be contingent upon the zoo's willingness to release the elephant that activists say has been kept in isolation since the controversial death of her longtime companion, Gita, in June. If moved, Ruby would have 500 times the space of her current enclosure at the zoo. Of the three elephants that the zoo had earlier this year, only the Indian elephant Billy is still on public display. Animal rights activists have been vocal opponents of the zoo's elephant exhibit and would like to see the exhibit closed and both elephants removed to a larger space. (Photo by David McNew/Getty Images)

  • Animal Activists Try To Remove Elephant From Los Angeles Zoo

    LOS ANGELES, CA - DECEMBER 13: Activists who support sending Ruby, a 45-year-old African elephant at the Los Angeles Zoo, to a sanctuary place their placards against a wall at a town hall meeting to discuss the conditions of elephants in captivity on December 13, 2006 in Los Angeles, California. The push to move Ruby to the PAWS sanctuary in San Andreas, California would be contingent upon the zoo's willingness to release the elephant that activists say has been kept in isolation since the controversial death of her longtime companion, Gita, in June. If moved, Ruby would have 500 times the space of her current enclosure at the zoo. Of the three elephants that the zoo had earlier this year, only the Indian elephant Billy is still on public display. Animal rights activists have been vocal opponents of the zoo's elephant exhibit and would like to see the exhibit closed and both elephants removed to a larger space. (Photo by David McNew/Getty Images)

  • Animal Activists Try To Remove Elephant From Los Angeles Zoo

    LOS ANGELES, CA - DECEMBER 13: An exhibit explains the social structure of elephants near the enclosure of the Indian elephant Billy which lives alone as the sole remaining elephant on public display at the Los Angeles Zoo while Ruby, a 45-year-old African elephant that activists want to send to a sanctuary, also resides alone and remains out of public view on December 13, 2006 in Los Angeles, California. The push to move Ruby to the PAWS sanctuary in San Andreas, California would be contingent upon the zoo's willingness to release the elephant that activists say has been kept in isolation since the controversial death of her longtime companion, Gita, in June. If moved, Ruby would have 500 times the space of her current enclosure at the zoo. Animal rights activists, including Assemblyman Lloyd Levine, D-Van Nuys, California, and 'The Price is Right' television host, Bob Barker, have been vocal opponents of the zoo's elephant exhibit and would like to see the exhibit closed and both elephants removed to a larger space. (Photo by David McNew/Getty Images)

  • Animal Activists Try To Remove Elephant From Los Angeles Zoo

    LOS ANGELES, CA - DECEMBER 13: The feet of Indian elephant Billy, sole remaining elephant on public display at the Los Angeles Zoo, are seen as Ruby, a 45-year-old African elephant that activists want to send to a sanctuary, remains out of public view on December 13, 2006 in Los Angeles, California. Captive elephants often develop foot problems that can be fatal. The push to move Ruby to the PAWS sanctuary in San Andreas, California would be contingent upon the zoo's willingness to release the elephant that activists say has been kept in isolation since the controversial death of her longtime companion, Gita, in June. If moved, Ruby would have 500 times the space of her current enclosure at the zoo. Animal rights activists, including Assemblyman Lloyd Levine, D-Van Nuys, California, and 'The Price is Right' television host, Bob Barker, have been vocal opponents of the zoo's elephant exhibit and would like to see the exhibit closed and both elephants removed to a larger space. (Photo by David McNew/Getty Images)

  • City Council To Vote On Fate Of Controversial Elephant Exhibit at L.A. Zoo

    LOS ANGELES, CA - JANUARY 28: Billy, the only elephant currently at the Los Angeles Zoo, is seen in his temporary exhibit after the Los Angeles City Council voted today to keep Billy at the zoo and continue construction of the $42 million Pachyderm Forest elephant exhibit on January 28, 2009 in Los Angeles, California. A parade of celebrities who oppose elephants in zoos fought to shut down the project and send Billy to a sanctuary facility, including Bob Barker, Cher, Lily Tomlin and Kevin Nealon. After the Pachyderm Forest was approved by the City Council in 2006, actor Robert Culp and real estate agent Aaron Leider sued the city to stop the project alleging that zoo officials abuse elephants but the lawsuit was thrown out by the Los Angeles Superior Court. When completed, the 3 1/2-acre Pachyderm Forest will house up to five Asian elephants and three of their offspring in an enclosure with a waterfall and two pools. (Photo by David McNew/Getty Images)

  • City Council To Vote On Fate Of Controversial Elephant Exhibit at L.A. Zoo

    LOS ANGELES, CA - JANUARY 28: Billy, the only elephant currently at the Los Angeles Zoo, is seen in his temporary exhibit after the Los Angeles City Council voted today to keep Billy at the zoo and continue construction of the $42 million Pachyderm Forest elephant exhibit on January 28, 2009 in Los Angeles, California. A parade of celebrities who oppose elephants in zoos fought to shut down the project and send Billy to a sanctuary facility, including Bob Barker, Cher, Lily Tomlin and Kevin Nealon. After the Pachyderm Forest was approved by the City Council in 2006, actor Robert Culp and real estate agent Aaron Leider sued the city to stop the project alleging that zoo officials abuse elephants but the lawsuit was thrown out by the Los Angeles Superior Court. When completed, the 3 1/2-acre Pachyderm Forest will house up to five Asian elephants and three of their offspring in an enclosure with a waterfall and two pools. (Photo by David McNew/Getty Images)

  • City Council To Vote On Fate Of Controversial Elephant Exhibit at L.A. Zoo

    LOS ANGELES, CA - JANUARY 28: Billy, the only elephant currently at the Los Angeles Zoo, is seen in his temporary exhibit after the Los Angeles City Council voted today to keep Billy at the zoo and continue construction of the $42 million Pachyderm Forest elephant exhibit on January 28, 2009 in Los Angeles, California. A parade of celebrities who oppose elephants in zoos fought to shut down the project and send Billy to a sanctuary facility, including Bob Barker, Cher, Lily Tomlin and Kevin Nealon. After the Pachyderm Forest was approved by the City Council in 2006, actor Robert Culp and real estate agent Aaron Leider sued the city to stop the project alleging that zoo officials abuse elephants but the lawsuit was thrown out by the Los Angeles Superior Court. When completed, the 3 1/2-acre Pachyderm Forest will house up to five Asian elephants and three of their offspring in an enclosure with a waterfall and two pools. (Photo by David McNew/Getty Images)

  • City Council To Vote On Fate Of Controversial Elephant Exhibit at L.A. Zoo

    LOS ANGELES, CA - JANUARY 28: Billy, the only elephant currently at the Los Angeles Zoo, is seen in his temporary exhibit after the Los Angeles City Council voted today to keep Billy at the zoo and continue construction of the $42 million Pachyderm Forest elephant exhibit on January 28, 2009 in Los Angeles, California. A parade of celebrities who oppose elephants in zoos fought to shut down the project and send Billy to a sanctuary facility, including Bob Barker, Cher, Lily Tomlin and Kevin Nealon. After the Pachyderm Forest was approved by the City Council in 2006, actor Robert Culp and real estate agent Aaron Leider sued the city to stop the project alleging that zoo officials abuse elephants but the lawsuit was thrown out by the Los Angeles Superior Court. When completed, the 3 1/2-acre Pachyderm Forest will house up to five Asian elephants and three of their offspring in an enclosure with a waterfall and two pools. (Photo by David McNew/Getty Images)

  • City Council To Vote On Fate Of Controversial Elephant Exhibit at L.A. Zoo

    LOS ANGELES, CA - JANUARY 28: Billy, the only elephant currently at the Los Angeles Zoo, is seen in his temporary exhibit after the Los Angeles City Council voted today to keep Billy at the zoo and continue construction of the $42 million Pachyderm Forest elephant exhibit on January 28, 2009 in Los Angeles, California. A parade of celebrities who oppose elephants in zoos fought to shut down the project and send Billy to a sanctuary facility, including Bob Barker, Cher, Lily Tomlin and Kevin Nealon. After the Pachyderm Forest was approved by the City Council in 2006, actor Robert Culp and real estate agent Aaron Leider sued the city to stop the project alleging that zoo officials abuse elephants but the lawsuit was thrown out by the Los Angeles Superior Court. When completed, the 3 1/2-acre Pachyderm Forest will house up to five Asian elephants and three of their offspring in an enclosure with a waterfall and two pools. (Photo by David McNew/Getty Images)

  • City Council To Vote On Fate Of Controversial Elephant Exhibit at L.A. Zoo

    LOS ANGELES, CA - JANUARY 28: Billy, the only elephant currently at the Los Angeles Zoo, is seen in his temporary exhibit after the Los Angeles City Council voted today to keep Billy at the zoo and continue construction of the $42 million Pachyderm Forest elephant exhibit on January 28, 2009 in Los Angeles, California. A parade of celebrities who oppose elephants in zoos fought to shut down the project and send Billy to a sanctuary facility, including Bob Barker, Cher, Lily Tomlin and Kevin Nealon. After the Pachyderm Forest was approved by the City Council in 2006, actor Robert Culp and real estate agent Aaron Leider sued the city to stop the project alleging that zoo officials abuse elephants but the lawsuit was thrown out by the Los Angeles Superior Court. When completed, the 3 1/2-acre Pachyderm Forest will house up to five Asian elephants and three of their offspring in an enclosure with a waterfall and two pools. (Photo by David McNew/Getty Images)

  • Animal Activists Try To Remove Elephant From Los Angeles Zoo

    LOS ANGELES, CA - DECEMBER 13: The Indian elephant Billy, sole remaining elephant on public display at the Los Angeles Zoo, is seen as Ruby, a 45-year-old African elephant that activist want to send to a sanctuary, remains out of public view on December 13, 2006 in Los Angeles, California. The push to move Ruby to the PAWS sanctuary in San Andreas, California would be contingent upon the zoo's willingness to release the elephant that activists say has been kept in isolation since the controversial death of her longtime companion, Gita, in June. If moved, Ruby would have 500 times the space of her current enclosure at the zoo. Animal rights activists, including Assemblyman Lloyd Levine, D-Van Nuys, California, and 'The Price is Right' television host, Bob Barker, have been vocal opponents of the zoo's elephant exhibit and would like to see the exhibit closed and both elephants removed to a larger space. (Photo by David McNew/Getty Images)

  • Animal Activists Try To Remove Elephant From Los Angeles Zoo

    LOS ANGELES, CA - DECEMBER 13: The Indian elephant Billy, sole remaining elephant on public display at the Los Angeles Zoo, is seen as Ruby, a 45-year-old African elephant that activist want to send to a sanctuary, remains out of public view on December 13, 2006 in Los Angeles, California. The push to move Ruby to the PAWS sanctuary in San Andreas, California would be contingent upon the zoo's willingness to release the elephant that activists say has been kept in isolation since the controversial death of her longtime companion, Gita, in June. If moved, Ruby would have 500 times the space of her current enclosure at the zoo. Animal rights activists, including Assemblyman Lloyd Levine, D-Van Nuys, California, and 'The Price is Right' television host, Bob Barker, have been vocal opponents of the zoo's elephant exhibit and would like to see the exhibit closed and both elephants removed to a larger space. (Photo by David McNew/Getty Images)

  • Animal Activists Try To Remove Elephant From Los Angeles Zoo

    LOS ANGELES, CA - DECEMBER 13: The Indian elephant Billy, sole remaining elephant on public display at the Los Angeles Zoo, is seen surrounded by chains as Ruby, a 45-year-old African elephant that activist want to send to a sanctuary, remains out of public view on December 13, 2006 in Los Angeles, California. The push to move Ruby to the PAWS sanctuary in San Andreas, California would be contingent upon the zoo's willingness to release the elephant that activists say has been kept in isolation since the controversial death of her longtime companion, Gita, in June. If moved, Ruby would have 500 times the space of her current enclosure at the zoo. Animal rights activists, including Assemblyman Lloyd Levine, D-Van Nuys, California, and 'The Price is Right' television host, Bob Barker, have been vocal opponents of the zoo's elephant exhibit and would like to see the exhibit closed and both elephants removed to a larger space. (Photo by David McNew/Getty Images)

  • An Asian elephant drinks water at the Lo

    An Asian elephant drinks water at the Los Angeles Zoo and Botanical Garden in Los Angeles on April 04, 2012. AFP PHOTO /JOE KLAMAR (Photo credit should read JOE KLAMAR/AFP/Getty Images)

  • Animal Activists Try To Remove Elephant From Los Angeles Zoo

    LOS ANGELES, CA - DECEMBER 13: The Indian elephant Billy, sole remaining elephant on public display at the Los Angeles Zoo, is seen as Ruby, a 45-year-old African elephant that activist want to send to a sanctuary, remains out of public view on December 13, 2006 in Los Angeles, California. The push to move Ruby to the PAWS sanctuary in San Andreas, California would be contingent upon the zoo's willingness to release the elephant that activists say has been kept in isolation since the controversial death of her longtime companion, Gita, in June. If moved, Ruby would have 500 times the space of her current enclosure at the zoo. Animal rights activists, including Assemblyman Lloyd Levine, D-Van Nuys, California, and 'The Price is Right' television host, Bob Barker, have been vocal opponents of the zoo's elephant exhibit and would like to see the exhibit closed and both elephants removed to a larger space. (Photo by David McNew/Getty Images)

Related on HuffPost: