
69 Cal.2d 828 (1968)
COUNTY OF RIVERSIDE, Petitioner,
v.
THE SUPERIOR COURT OF SAN DIEGO COUNTY, Respondent; DESERT OUTDOOR ADVERTISING, INC., et al. Real Parties in Interest.
Supreme Court of California. 
Dec. 11, 1968.
 Ray T. Sullivan, Jr., County Counsel, and Tilden L. Brooks, Deputy County Counsel, for Petitioner.
 No appearance for Respondent. *829
 Swing, Scharnikow, Lewis & Kroll and David K. Kroll for Real Parties in Interest.
 BURKE, J.
 Petitioner County of Riverside seeks prohibition and mandamus to compel respondent Superior Court of San Diego County to (1) set aside a temporary restraining order and order to show cause issued February 7, 1968, in an action brought against petitioner in respondent court by Desert Outdoor Advertising, Inc. et al. (Desert), real parties in interest herein, (2) set aside a minute order of February 19, 1968, ordering transfer of the action to the Superior Court of San Mateo County, and (3) order the action transferred to Riverside County. We have concluded that Code of Civil Procedure section 395, subdivision (1),  [fn. 1] places venue of the action in the County of Riverside and that petitioner is entitled to the relief sought.
 Desert commenced the main action on January 9, 1968, when it filed its complaint in respondent court seeking to have declared invalid an ordinance of the County of Riverside regulating the use of display advertising signs, in the construction and maintenance of which Desert is engaged, and also asking that enforcement of the ordinance be enjoined pending trial. Named as defendants, in addition to the County of Riverside, were numerous officers of that county and several municipal and justice courts of judicial districts situated within Riverside County.
 On January 26 all defendants in the main action filed a demurrer to the complaint, and also a notice that on February 14, at 1:45 p.m., they would move for an order that the action be transferred to the Superior Court of Riverside County, on (1) the ground that all defendants resided in Riverside County (see  395, subd. (1)) and (2) the grounds set forth in section 393, subdivision (1)(b).  [fn. 2] The notice further stated that should the motion on those grounds be denied, then defendant County of Riverside would move for itself under section 394 for an order transferring venue to the Superior Court of San Bernardino County.
 On February 14, at 10:55 a.m., Desert caused a written *830 dismissal of the action without prejudice to be filed as to all defendants except petitioner county. Meantime, on February 7 Desert obtained the temporary restraining order and order to show cause, the vacation of which is one of the objectives of the present proceeding.
 On February 19 petitioner's motion for transfer of the action was heard, and the court made the following minute order: "Def'ts motion for change of venue is granted. This matter to be transferred to San Mateo County pursuant to Sec. 394 CCP. TRO's to be continued in effect until such time as San Mateo Court considers the application for preliminary injunction."  [fn. 3]
 [1a] Petitioner County of Riverside correctly contends that as the sole defendant remaining in the main action it is entitled under sections 395 and 396b to have the cause transferred to Riverside County as the county of its residence, and that the trial court erred in ordering the transfer to San Mateo County.  [fn. 4] Section 392 provides that the venue of certain actions involving real property is the county in which the property is situated, section 393 provides that the venue of actions to recover a statutory penalty or forfeiture and actions against public officers in respect to their duties is the county in which the cause of action arose, and section 395 provides that "In all other cases" the proper venue is in the county of defendant's residence, with certain exceptions and alternatives not material here.
 The reliance of Desert (real party in interest) upon the provisions of section 394 in support of the transfer to a "neutral" county, here ordered by respondent court, is misplaced.  [fn. 5] [2] As stated in Skidmore v. County of Solano *831 (1954) 128 Cal.App.2d 391, 394 [275 P.2d 613], section 394 is a removal statute which applies only when an action has been brought and is pending in a proper court. (See also San Jose Ice & Cold Storage Co. v. San Jose (1937) 19 Cal.App.2d 62, 66 [64 P.2d 1099, 65 P.2d 1324]; Fitzpatrick v. Sonoma County (1929) 97 Cal.App. 588, 592, 594, 596 [276 P. 113].) This view of section 394 as only a removal statute is confirmed by the appearance in the first sentence of each of the venue sections ( 392, 393, 395) of the proviso "Subject to the power of the court to transfer actions and proceedings as provided in this title ...," and the absence of a similar proviso from section 394. Sections 392, 393 and 395, which specify the proper county for initial filing of an action, are thus made subject to the court's power under the transfer sections, including section 394. [1b] It follows that pursuant to section 395 petitioner County of Riverside is entitled to have the main action transferred to Riverside County in which it resides.  [fn. 6] (See Skidmore v. County of Solano, supra, 128 Cal.App.2d 391, 393, fn. 2.) As petitioner concedes, our ruling to this effect will not preclude Desert from applying to the Riverside Court for a transfer to a different county under the provisions of section 397 (see also section 400).
 The temporary restraining order and order to show cause issued on February 7, pending the hearing of petitioner's motion for transfer of the action, exceeded the authority of respondent court and will be set aside. (Nolan v. McDuffie (1899) 125 Cal. 334, 336-337 [58 P. 4]; Beard v. Superior Court (1940) 39 Cal.App.2d 284, 286 [102 P.2d 1087].)
 Let a peremptory writ of mandamus issue commanding respondent court to (1) set aside its temporary restraining order and order to show cause issued on February 7, 1968, (2) set aside its minute order of February 19, 1968, ordering transfer of this action to the Superior Court of San Mateo County, (3) transfer this action to the Superior Court of Riverside County.
 Traynor, C. J., McComb, J., Peters, J., Tobriner, J., Mosk, J., and Sullivan, J., concurred.
NOTES
[fn. 1]  1. All section references are to the Code of Civil Procedure.
[fn. 2]  2. Section 393, in pertinent part: "(1) Subject to the power of the court to transfer actions ... as provided in this title, the county in which the cause, or some part thereof, arose, is the proper county for the trial of the following actions: ... (b) Against a public officer or person especially appointed to execute his duties, for an act done by him in virtue of his office; or against a person who, by his command or in his aid, does anything touching the duties of such officer."
[fn. 3]  3. In opposition to the motion to transfer the action, a declaration had been filed containing statements from which the trial court could have found that Desert was doing business in the Counties of Riverside, San Bernardino, Imperial, Orange, San Diego and Los Angeles. (See third sentence of section 394, subdivision (1).)
[fn. 4]  4. It has not been questioned that the dismissal of the action as to the individual defendants eliminated reliance upon the provisions of section 393, subdivision (1)(b) (see ante, fn. 2), as a ground for transfer. (See Prendergast v. Mitchell-Silliman Co. (1924) 65 Cal.App. 456, 459-460 [224 P. 243]; cf. Brady v. Times-Mirror Co. (1895) 106 Cal. 56, 60-62 [39 P. 209]; Remington Sewing Machine Co. v. Cole (1882) 62 Cal. 311, 318.)
[fn. 5]  5. Section 394 in pertinent part: "An action ... against a county ... may be tried in such county. ... Whenever an action ... is brought against a county ... in any county ... other than the defendant ... the action ... must be, on motion of the said defendant, transferred for trial to a county ... other than that in which the plaintiff ... resides, or is doing business, or is situated ... and other than the defendant county. ..."
[fn. 6]  6. Nothing in the record before us supports Desert's suggestion that petitioner acquiesced in the transfer to San Mateo County ordered by respondent court, or otherwise waived its rights to have the action transferred to its home county under section 395.
