
233 Cal.App.2d 737 (1965)
HAYWARD UNIFIED SCHOOL DISTRICT, Petitioner,
v.
SUPERIOR COURT OF ALAMEDA COUNTY, Respondent; LINDA GALLOUPE, Real Party in Interest.
Civ. No. 22684. 
California Court of Appeals. First Dist., Div. Two.  
Apr. 21, 1965.
 Bennett & Van De Poel, Kenneth A. Meade and John F. Van De Poel for Petitioner.
 No appearance for Respondent.
 Newman, Marsh & Furtado and Edward F. Newman for Real Party in Interest.
 AGEE, J.
 Petitioner school district seeks a writ of prohibition to restrain respondent superior court from proceeding with a personal injury action brought against it by the real party in interest, plaintiff therein.
 [1a] The complaint in said action was filed on February 20, 1964. Petitioner, as defendant therein, served a demand for security for costs upon plaintiff on June 8, 1964, as provided in section 947, subdivision (a), of the Government Code, as follows:
 "At any time after the filing of the complaint in any action against a public entity, the public entity may file and serve a demand for a written undertaking on the part of each plaintiff as security for the allowable costs which may be awarded against such plaintiff. The undertaking shall be in the amount of one hundred dollars ($100), or such greater sum as the court shall fix upon good cause shown, with at least two sufficient sureties, to be approved by the court. Unless the plaintiff files such undertaking within 20 days after service of a demand therefor, his action shall be dismissed." *739
 No undertaking was filed by plaintiff within the 20-day period. On September 4, 1964, petitioner filed a notice that on October 9, 1964, it would move to dismiss the action for failure to file the undertaking. On September 11, 1964 plaintiff filed the undertaking. The motion to dismiss was argued and submitted on October 9, 1964. It was denied on October 23, 1964.
 Petitioner contends that respondent court had no jurisdiction to act except to dismiss the action, stating that section 947, subdivision (a), "deprives the trial court of any discretion to permit the filing of an undertaking after 20 days have elapsed from the date a demand therefor has been made" and "relieves the trial court of any power to act, except to dismiss the action, when a plaintiff has failed to file an undertaking within the specified time."
 Petitioner relies upon Abelleira v. District Court of Appeal, 17 Cal.2d 280 [109 P.2d 942, 132 A.L.R. 715], which holds that prohibition will lie "where, though the court has jurisdiction over the subject matter and the parties in the fundamental sense, it has no 'jurisdiction' (or power) to act except in a particular manner, ..." (p. 288).
 Section 947, subdivision (a), of the Government Code was enacted in 1963. Its subject matter was originally covered in the third paragraph of former section 688 of the Political Code, enacted in 1929 and repealed in 1945. The successor statute was section 16047 of the Government Code, enacted in 1945 and repealed in 1959. Its successor was section 647 of the Government Code, enacted in 1959, amended in 1961, and repealed in 1963.
 Throughout the 1929-1961 period the existing statute contained the provision that, "At the time of filing the complaint ..., the plaintiff shall file therewith an undertaking ..." (italics ours).
 [2] This provision was unchanged by the 1961 amendment to the then existing statute (Gov. Code.,  647) but the following sentences were added at the end thereof: "Where no such undertaking is filed at the time of the filing of the complaint the State may file and serve a demand therefor. Within twenty (20) days after service of a demand, the plaintiff shall file an undertaking as required herein or the action shall be dismissed."
 The effect upon the existing statute by the addition of these two sentences was to change the time when an action *740 could be dismissed for failure to file the required undertaking. Under the statute as so amended in 1961, although the time when the plaintiff was directed to file the undertaking remained fixed as "the time of filing the complaint," the action was no longer subject to dismissal for a failure to do so until (1) a demand had been made that an undertaking be filed and (2) plaintiff had failed to file such undertaking within 20 days after service of such demand.
 [3] Any apparent confusion in the wording of section 647 as to the time when the undertaking should be filed, i.e., whether at "the time of filing the complaint" or within 20 days after demand therefor has been served upon plaintiff, was cleared up by the wording of section 947, subdivision (a).
 As we have seen, this 1963 enactment eliminated the necessity of filing an undertaking at all except upon service of a demand therefor, whereupon the action became subject to dismissal if plaintiff failed to comply with said demand.
 As related to the facts herein, the pre-1961 statute would have required the filing of an undertaking on February 20, 1964, the date on which the complaint was filed. Under the statute as amended in 1961 and now, plaintiff was required to file the undertaking within 20 days after June 8, 1964.
 [4] The statutory amendments of 1961 to section 647 and the 1963 enactment of section 947, subdivision (a), insofar as they changed the date when the undertaking should have been filed, did not change the existing law as to the power (jurisdiction) of the court to accept a late filing.
 In the only appellate decisions under the subject statute which involved a late filing of an otherwise proper undertaking, the refusal of the lower court to dismiss the action was affirmed on appeal.
 In State of California v. Superior Court (1939) 34 Cal.App.2d 628 [94 P.2d 63], the undertaking was defective because it was not accompanied by an affidavit of the sureties. Defendant's motion to dismiss was denied. This ruling was affirmed on appeal, the opinion pointing out that, "[p]rior to the date of said hearing plaintiffs filed such affidavit in the form required by the statute ...."
 In Spence v. State of California (1961) 198 Cal.App.2d 332 [18 Cal.Rptr. 302], the complaint was filed on February 25, 1959. Defendants moved for summary judgment on the ground that plaintiff had failed to file the required undertaking. On January 25, 1960 the motion was denied and *741 plaintiff was permitted to file the undertaking nunc pro tunc as of February 25, 1959. This ruling was affirmed on appeal, the opinion stating that the "delay in filing [the undertaking] is not fatal to plaintiff's cause of action since the court permitted a late filing." (P. 336.)
 [5] However, when no undertaking whatever has been filed, the courts have always interpreted the statute as requiring a dismissal of the action upon proper application therefor. (Cf. Stafford v. People ex rel. Dept. of Public Works (1961) 195 Cal.App.2d 148 [15 Cal.Rptr. 402]; Standahl v. Splivalo (1936) 13 Cal.App.2d 85 [56 P.2d 298].)
 [6] Hence the 1961 addition to section 647, that "the action shall be dismissed," and the similar 1963 provision in section 947, subdivision (a), that "his [plaintiff's] action shall be dismissed" upon failure to file the undertaking, were confirmatory of the established case law. There is nothing in the amendments of 1961 and 1963 which indicates any intention by the Legislature to eliminate the power of the court to accept the late filing of the undertaking.
 An analogous situation is found in libel and slander actions, wherein the plaintiff is required to file a $500 undertaking and the statute provides that "An action brought without filing the required undertaking shall be dismissed." (Code Civ. Proc.,  830.) This provision has been part of the statute since its original enactment. (Stats. 1871-1872, ch. 377.)
 Nonetheless, it has been consistently held that the court does not lose its jurisdiction by the failure to file such undertaking and that it may permit a late filing thereof. (Pacific View Hospital v. Superior Court, 189 Cal.App.2d 395, 397-398 [11 Cal.Rptr. 312], citing numerous precedents; Williams v. Superior Court, 7 Cal.App.2d 436, 437 [45 P.2d 1027].)
 The basic reasoning behind such holding is found in Becker v. Schmidlin, 153 Cal. 669, 671 [96 P. 280], wherein the Supreme Court said: "The jurisdiction of the court in an action for slander does not depend upon whether a sufficient undertaking is or is not filed at the time the suit is commenced. It has such jurisdiction even when no undertaking at all is filed, and may permit one to be filed subsequent to the commencement of the action, and, of course, may permit a new undertaking to be filed in lieu of a defective one. [Citations.]"
 "It is true that a plaintiff neglecting to file a sufficient *742 undertaking when suit is commenced incurs the danger of having his action dismissed upon the motion of the defendant for such failure, but when such motion is made and is well taken, the court may, nevertheless, in the exercise of a sound discretion, having jurisdiction of the action, permit the plaintiff to file a new and sufficient undertaking. The undertaking provided by the statute to be given runs in terms in favor of a defendant, and is intended to secure him in the costs and charges of the action which may ultimately be awarded him. The provision is for his sole benefit and this being true, the discretion vested in the court of permitting plaintiff to file a new undertaking which will afford a defendant all the protection the law intends should be exercised to effect that end. So exercised, it will permit the cause to be tried on its merits, which the law favors, instead of preventing it, which it discountenances."
 [1b] We have concluded herein that the lower court had jurisdiction to accept the late filing of the undertaking and to deny the motion to dismiss.
 The alternative writ of prohibition heretofore issued is discharged and a peremptory writ is denied.
 Shoemaker, P. J., and Taylor, J., concurred.
