The plaintiff brought this action to recover damages allegedly sustained when she was attacked by a dog used by the police department of the City of Salem in law enforcement work. The trial judge granted a *41nonsuit on the ground that the dog was being used in the performance of a governmental function. Plaintiff appeals.
Viewed in the light most favorable to the plaintiff the evidence tends to prove the following facts. Plaintiff with her husband and a party of relatives and friends, after spending the evening at a tavern, went to the China Cafe in Salem early on a Sunday morning in April, 1966. At about 3:00 a.m. the management called the police to evict plaintiff’s husband and his nephew from the restaurant because their conduct was “out of the way.” During the arrest there was a commotion in front of the restaurant and a crowd gathered. While the plaintiff was standing on the sidewalk in front of the restaurant near a patrol car into which the police were putting her husband, a police dog leaped upon her, spun her around, pinned her against the wall, tore her blouse and bit her on the right shoulder. The dog had been brought to the scene on leash by police officer Ziebert from another patrol car parked in the vicinity.
The plaintiff first contends that the court erred in granting the nonsuit because the city had waived its governmental immunity by failing to plead it. It did not appear from plaintiff’s complaint that the dog was being used in law enforcement work at the time of the alleged attack on plaintiff. The defense of governmental immunity, therefore, could not be raised by demurrer, but only by answer. The city did raise the defense by pleading in its answer the ultimate facts from which governmental immunity is implied as a matter of law, i.e., its status as a municipality and the use of the dog at the time of the alleged attack as an aid in the governmental function of law enforcement. It was not necessary to allege the legal conclusion that *42the city was immune.① We find no merit in the first assignment of error.
The plaintiff also contends that the court erred in granting the nonsuit because the use of a vicious dog with knowledge of its vicious propensities is a nuisance, and the city is not immune from liability for nuisance. The law is well settled that a person who keeps a vicious dog with knowledge of its vicious propensities is liable for harm caused by the dog, although he has exercised the utmost care to prevent it. Liability is based on the creation or maintenance of a public nuisance and does not depend on negligence. Hunt v. Hazen, Adm., 197 Or 637, 639, 254 P2d 210 (1953); Jaco v. Baker, 174 Or 191, 198, 148 P2d 938 (1944); Anno. 79 ALR 1060, 1062 (1932); 4 Am Jur2d 312, Animals § 63 (1962); 3 CJS 1256, Animals § 151 (1936); Restatement of Torts §509, comment f at 21 (1938) .
It is also true that this court has held that even when acting in a governmental capacity cities are not immune from liability for harm caused by the maintenance of either a public or a private nuisance. Levene v. City of Salem, 191 Or 182, 197, 229 P2d 255 (1951); Adams v. City of Toledo, 163 Or 185, 191, 96 P2d 1078 (1939) . The rule has been applied in an action for damages for personal injuries. Wilson v. City of Portland, 153 Or 679, 685, 58 P2d 257 (1936). See also, anno. 56 ALR2d 1415, 1419. Our cases are in harmony with the general rule. 18 McQuillin, Municipal Corporations (3d ed rev) § 53.49.
*43Assuming that the jury could infer from the dog’s conduct in jumping upon and biting plaintiff that the dog was vicious, we are unable to find in the record any evidence that defendant knew or should have known that the dog had vicious propensities. The only evidence concerning the prior conduct of the dog was the testimony of Officer Ziebert. He testified that he had been in charge of the dog since it was acquired by the city in February, 1965, that he kept the dog at his home except when it was with him on patrol, that he had two children who played with the dog, and that the dog had never bitten or injured anyone or displayed any temper or vicious propensities. The officer testified that the dog had been trained to attack on command, or if his master was attacked or threatened. The officer admitted that he had not ordered the dog to attack on this occasion; but if this was evidence of a vicious propensity, there is no indication that the dog had ever before been guilty of any breach of discipline or unordered attack on anyone. There is also no evidence that the training of the dog for police work had imbued it with any dangerous propensities.
The burden was on the plaintiff to prove both that the dog was vicious and that the defendant knew of the dog’s vicious propensities. Butler v. Pantekoek, 231 Or 563, 568, 373 P2d 614 (1962). Since the plaintiff failed to prove the second element of her alleged cause of action, the trial court did not err in granting a nonsuit. It is immaterial whether the trial court gave the right reason for granting the nonsuit, if it should have been granted on any ground. Russell v. Congregation of Neveh Zedeck, 236 Or 291, 296, 388 P2d 272 (1964).
The judgment is affirmed.
“On any pleading the party making it is entitled to the benefit of any legal conclusion which may be properly drawn from the facts stated.” Leadbetter v. Hawley, 59 Or at 427, 117 P at 506. See also, 41 Am Jur 300, Pleading § 16; 7.1 CJS 34, Pleading § 13.