A baby gorilla born in a rare Caesarean section at the San Diego Zoo last week has pneumonia and was treated for a collapsed lung.

The 17th gorilla delivered at the Southern California zoo developed the illness, an inflammation of the lungs with congestion, around the time of her birth, according to a statement from the San Diego Zoo Safari Park on Tuesday (local time).

"We've been working with the baby all weekend and after having several days of experience treating her, it's pretty obvious that we've been dealing with pneumonia," Nadine Lamberski, associate director of veterinary services at the park, said in a statement.

Zoo spokeswoman Christina Simmons said veterinarians performed a procedure to inflate a collapsed lung on the animal, an endangered western lowland gorilla. "We continue to be cautiously optimistic," she said. The gorilla has not yet been named.

The zoo said the baby's 18-year-old mother, Imani, was recovering well since the birth, which involved delivering the baby through the abdominal wall and uterus. They are among eight gorillas at the zoo.