
199 N.W.2d 158 (1972)
Chester HOFFERT et al., Appellants,
v.
OWATONNA INN TOWNE MOTEL, INC., defendant and third-party plaintiff, Appellant,
v.
THRIFTY DRUG STORES, INC., et al., third-party defendants, City of Owatonna, third-party defendant, Respondent.
No. 43120.
Supreme Court of Minnesota.
May 19, 1972.
*159 John Walbran, Owatonna, for Hoffert and others.
Lasley, Anderson & Roehrdanz, Minneapolis, for Owatonna Inn Towne Motel.
Carroll, Cronan, Roth & Austin, Minneapolis, for respondent.
Heard before KNUTSON, C. J., and KELLY, TODD, and MASON, JJ.
TODD, Justice.
These actions arose out of a fire which occurred at the Owatonna Inn Towne Motel in December 1969. In one, Charles W. Mason as trustee seeks to recover for the wrongful death of Charles M. Mason. In the others Chester and Audrey Hoffert and Ronald and Marilyn Follmann seek damages for personal injuries. All suits name the motel as a defendant, and plaintiffs Hoffert also sued the city. In all actions the motel brought a third-party action against the city for indemnity or contribution on the theory that the plaintiffs' damages resulted from the city's negligence in issuing a building permit for remodeling of the motel in a manner which violated the city's building code. The third-party complaints and the complaint of plaintiffs Hoffert against the city were dismissed by the trial court on the grounds that the issuance of a building permit for construction which violated the building code of Owatonna did not create a cause of action against the city. We affirm.
In the summer of 1969, the motel management decided to make improvements on its property, including enclosures of certain areas. The proposal was submitted to the city of Owatonna. The premises were inspected by the building inspector and the city engineer and a building permit issued. Inspection was made during construction by the building inspector. On December 22, 1969, about 2 weeks after the final inspection, at about 2 a. m., a fire broke out in the motel. Plaintiffs Hoffert and Follmann and plaintiff Mason's decedent were quartered as guests. Plaintiffs Hoffert and Follmann allege they were trapped in the second story of the motel because of improper stairway enclosures constructed in violation of the building code, and plaintiff trustee claims that the decedent was similarly trapped. The motel gave proper notice of claim to the city under Minn.St. 466.05, but none of the plaintiffs properly served notice upon the city.
Prior to trial, the city of Owatonna made a motion to dismiss the Hoffert complaint and the motel's third-party complaints on the grounds that they failed to state a cause of action upon which relief could be granted. On February 27, 1971, the court granted the motion, and plaintiffs Hoffert and the motel appeal from its order.
Respondent raised the question of whether or not the order is appealable, but rather than properly moving to dismiss the appeal, it instead submitted the matter on briefs and oral argument. Therefore, we do not decide that issue.
1. Appellants contend that they are entitled to recover under the provisions of § 466.02 which, with certain exceptions, abolished the defense of immunity from tort liability for acts of municipalities performed in the exercise of a governmental or proprietary function. Although discretionary acts are excepted from that section by § 466.03, subd. 6, the city admits that by acquiring liability insurance under § 466.06, it has waived this exception. However, these statutory provisions merely removed the defense of immunity. They did not *160 create any new liability for a municipality. In order to recover against the city, appellants must show a breach of some duty owed them in their individual capacities and not merely a breach of some obligation owed the general public.
2. The purpose of a building code is to protect the public. This is well stated in 7 McQuillin, Municipal Corporations (3 ed.) § 24.507, p. 523:
"* * * The enactment and enforcement of building codes and ordinances constitute a governmental function. The primary purpose of such codes and ordinances is to secure to the municipality as a whole the benefits of a well-ordered municipal government, or, as sometimes expressed, to protect the health and secure the safety of occupants of buildings, and not to protect the personal or property interests of individuals."
Building codes, the issuance of building permits, and building inspections are devices used by municipalities to make sure that construction within the corporate limits of the municipality meets the standards established. As such, they are designed to protect the public and are not meant to be an insurance policy by which the municipality guarantees that each building is built in compliance with the building codes and zoning codes. The charge for building permits is to offset expenses incurred by the city in promoting this public interest and is in no way an insurance premium which makes the city liable for each item of defective construction in the premises.
This court in Roerig v. Houghton, 144 Minn. 231, 235, 175 N.W. 542, 544 (1919), held that a building inspector acts exclusively for the benefit of the public. The act performed is only for public benefit, and an individual who is injured by any alleged negligent performance of the building inspector in issuing the permit does not have a cause of action. See, Hitchcock v. County of Sherburne, 227 Minn. 132, 135, 34 N.W.2d 342, 344 (1948); Stevens v. North States Motor, Inc., 167 Minn. 345, 201 N.W. 435 (1925); Modlin v. City of Miami Beach, 201 So.2d 70 (Fla.1967); Meadows v. Village of Mineola, 190 Misc. 815, 72 N.Y.S.2d 368 (1947); Whitney v. City of New York, 27 A.D.2d 528, 275 N. Y.S.2d 783 (1966).
Consequently, the waiver of governmental immunity by the city of Owatonna does not benefit appellants since the ordinance does not create a duty toward them as individuals.
Affirmed.
MacLAUGHLIN, J., not having been a member of this court at the time of the argument and submission, took no part in the consideration or decision of this case.
