Plaintiff appeals from a judgment in favor of defendant after trial of an action instituted to obtain (1) a mandatory injunction directing defendant to remove obstructions erected in and across the entrance to Argent Alley from Market Street in San Francisco, and (2) damages resulting from the obstruction of the entrance to the alley.
Argent Alley is a 10-foot public alley on the east slope of Twin Peaks in San Francisco, connecting Market and Corbett Streets. It is too steep and narrow for vehicular use, and since its dedication by recordation of a subdivision map in 1867 the public has always used it solely as a pedestrianway. It is the sole route for pedestrians between Market and Corbett Streets without going two blocks out of their way. Six other alleys in the same area, all dedicated at the same time, have always been used exclusively as pedestrianways.
*847The following photograph is a view of the alley looking in a westerly direction from its intersection with Market Street:
On November 1, 1951, plaintiff bought a house and lot at 4512 23d Street. The rear of this lot, which contained a large depression, abuts on Argent Alley. At that time Argent Alley was impassable to vehicles.
Plaintiff, without the required permit from the city’s department of public works (defendant herein), brought a bulldozer into the alley and graded many tons of earth out of it, *848and used the earth to fill in and level off his lot. He then commenced running trucks in the alley from Market Street to his property. This resulted in the alley being impassable to pedestrians.
Residents of the district complained to defendant, who found the condition existing to be dangerous to the public, halted plaintiff’s running of trucks in the alley by removing a ramp and bringing the Market Street sidewalk up to the official grade, and installed a 4-inch iron post imbedded in concrete at the entrance to the alley.
Plaintiff then applied to defendant for a permit to build a paved roadway in the alley. This was denied. Plaintiff did not appeal to the city’s board of permit appeals, but instead instituted the instant action. After trial without a jury the trial court made the following findings of fact*: (1) the alley was dedicated to public use as a pedestrianway; (2) the running of vehicles therein was dangerous to the public; and (3) plaintiff, because of his unlawful disregard of the city’s permit procedure, did not come into court with “clean hands,” and therefore was not entitled to relief. Judgment was accordingly rendered for defendant.
Questions
First-. Was plaintiff’s cause of action barred by the fact that he did not exhaust his administrative remedy prior to instituting the present suit?
Yes. Section 106 of the San Francisco Charter, which became effective January 8, 1932 (Stats. 1931, p. 3041), reads:
“The director of public works shall have and succeed to the powers and duties of the Board of Public Works from and after twelve o’clock noon on the 8th day of January, 1932.”
Article VI, chapter I, section 9, subdivision 1 of San Francisco’s Charter of 1900 (Stats. 1899, pp. 286-287) read:
“The Board of Public Works shall have charge, superintendence and control, under such ordinances as may from time to time be adopted by the supervisors :
“1. Of all public ways, streets, avenues, lanes, alleys, places, courts, roads, highways and boulevards now opened or which may hereafter be opened in the city and county; of the manner of their use; and of all work done upon . . . the same; and herein particularly the board shall have exclusive authority to prescribe rules and grant permits, in conformity *849with the ordinances of the supervisors, for . . . the using of the street or any portion thereof . . . for any purpose other than such as ordinarily and properly belongs to the public from the dedication thereof to public use, and without such permission in writing from said Board no person shall do any of the acts in this section enumerated; . . ..”
Section 24 of the San Francisco Charter, effective in 1932 (Stats. 1931, pp. 2991-2992), read: “The board of supervisors shall regulate, by ordinance, the issuance . . . of . . . permits for the use of . . . public streets and places, .... Permits . . . shall be issued by the departments as designated by ordinance, only after formal application for such permit. ... If any application for a permit ... is denied by the department authorized to issue same, the applicant may appeal to the board of permit appeals.”
Section 39 of the San Francisco Charter of 1932 (Stats. 1931, pp. 3001-3002) read: “Any applicant for a permit . . . who is denied such a permit ... by the department authorized to issue same ... or any person who deems that his interests or property or that the general public interest will be adversely affected as the result of operations authorized by or under any permit . . . granted or issued by any department, may appeal to the board of permit appeals. Such board shall hear the applicant, the permit-holder, or other interested parties, as well as the head or representative of the department issuing or refusing to issue such . . . permit . . . After such hearing and such further investigation as the board may deem necessary, it may concur in the action of the department authorized to issue such . . . permit, or, by the vote of four members, may overrule the action of such department and order that the permit ... be granted ... or refused.” Section 335 of the San Francisco Public Works Code reads in part: “It shall be unlawful for any person ... to make . . . any excavation in . . . the surface of any public . . . alley . . . without first obtaining from the Department of Public Works a written certificate that such person ... is entitled to make such excavation. ...”
In view of the foregoing provisions of the city charter, it is apparent that after plaintiff was denied a permit to build a paved roadway in the alley administrative procedure required that he apply to the city’s board of permit appeals. This he failed to do, and the established rule is here applicable that one is not entitled to judicial relief until the pre*850scribed administrative remedy is not only invoked but exhausted. (United States v. Superior Court, 19 Cal.2d 189 at 194 [1] [120 P.2d 26]; Abelleira v. District Court of Appeal, 17 Cal.2d 280 at 291 [5] [109 P.2d 942, 132 A.L.R. 715]; Myers v. Bethlehem Shipbuilding Corp., 303 U. S. 41, 50 et seq. [58 S.Ct. 459, 82 L.Ed. 638]; cf. Lindell Co. v. Board of Permit Appeals, 23 Cal.2d 303, at 314 [144 P.2d 4].)
Hence, the trial court properly found that since plaintiff did not exhaust his administrative remedies he was not entitled to judicial relief.
Second: Was plaintiff properly denied relief because he did not come into court with “clean hands”?
Yes. [2] The rule is settled in California that whenever a party who, as actor, seeks to set judicial machinery in motion and obtain some remedy, has violated conscience, good faith or other equitable principle in his prior conduct, then the doors of the court will be shut against him in limine; the court will refuse to interfere on his behalf to acknowledge his right, or to afford him any remedy. (DeGarmo v. Goldman, 19 Cal.2d 755 at 764 [5] et seq. [123 P.2d 1]; Bowman v. Bowman, 125 Cal.App. 602 at 612 [5] [13 P.2d 1049, 14 P.2d 558].)
The foregoing rule is applicable to the facts presented in the instant ease. The record discloses that plaintiff, without written permit and in violation of the San Francisco Public Works Code, graded Argent Alley so as to make it available for vehicular traffic when it had been previously used solely for pedestrian traffic. By grading a roadway into the alley without a permit, plaintiff circumvented the city’s permit procedure established for the protection of the public. Upon either the granting or denial of a permit, the procedure provided for an appeal to the board of permit appeals—by the applicant if the permit was denied; or, if granted, by any person who deemed his interests or property would be adversely affected as the result of operations under the permit.
By ignoring the city’s permit procedure and building the road without a permit, then suing defendant, the Director of Public Works, for a mandatory injunction, plaintiff attempts to nullify the procedure established by law, denies the public the hearing to which it is entitled, and flouts the public interest which the procedure was designed to protect. Obviously the public, whom defendant represents, was injured by plaintiff’s illegal conduct and the “clean hands” doctrine applies to him.
*851Third: Was defendant estopped because of certain unauthorized acts of employees of the city and county of Sam, Francisco from asserting its rights to claim that plaintiff had not complied with the statute relative to changing Argent Alley into a vehicular street?
No. In 1924 Argent Alley was a path for pedestrians. At that time Market Street in the vicinity of the seven alleys (including Argent) was being improved under contract.
The grade of the sidewalk in front of Argent Alley had been established by the board of supervisors as being level with the walk on each side, with no depression therein. The official plans called for the curb in front of Argent Alley and the other six alleys to be continuous, without the customary break and turning in of the curbs found at intersecting vehicular ways, and for a concrete stairway to rise from the street level to the sidewalk level in front of Argent Alley.
A city civil service examiner named Zion owned property at the northwest corner of Market Street and Argent Alley. He requested the city’s engineering department, instead of building the concrete stairs as called for by the plans, to “build this ramp up here so that we could use it for our property to move in. ’ ’
Without change in the official plans or change in the sidewalk grade established by the supervisors, the engineering department personnel caused the contractor to build a ramp where stairs were called for, to shift the stairs 10 feet south, and to build a 10- to 12-inch depression in the outer half of the sidewalk to accommodate the ramp and keep a vehicle ascending the ramp from hanging up on the edge of the sidewalk. The continuous curb was not changed, but a triangular asphalt plug was inserted between the curb and the street so a vehicle could cross the curb.
It is contended that this unlawful construction for Zion’s benefit and Zion’s vehicular use of the alley for 15 years constituted public acceptance of Argent Alley for vehicular use (although the public had used it exclusively as a pedestrianway since 1867) and therefore the unauthorized conduct of the engineering department raised an estoppel against the public and in favor of plaintiff.
Such is not the law. Mr. Chief Justice Gibson, in County of San Diego v. California Water & Tel. Co., 30 Cal.2d 817 at 826 [186 P.2d 124, 175 A.L.R. 747], thus accurately states *852the rule: “It is clear, however, that neither the doctrine of estoppel nor any other equitable principle may be invoked against a governmental body where it would operate to defeat the effective operation of a policy adopted to protect the public. (Citations.)” (Simons Brick Co. v. City of Los Angeles, 182 Cal. 230 at 237 [4] [187 P. 1066]; Gardella v. County of Amador, 164 Cal. 555 at 564 [129 P. 993]; see also cases cited in 10 Cal.Jur. (1923), p. 652, Estoppel, note 4.)
It is thus evident that the doctrine of estoppel was not available to plaintiff under the facts of the present case.
The judgment is affirmed.
Gibson, C. J., Traynor, J., and Spence, J., concurred.
Plaintiff does not question the sufficiency of the evidence to sustain the trial court’s findings of fact.