McAdam, J.
The defendant interposed a demurrer to the complaint, whereupon the plaintiff, without waiting till the defendants’ time to amend had expired, moved for judgment upon the demurrer. The day before that named for the argument thereof, the defendants served an answer as an amended pleading. This they had the right to do (Robertson agt. Bennett, 1 Abb. N. C., 476). The defendants having amended within the time allowed by law for that purpose, the answer superseded the demurrer (4 How. Pr. 174; 3 Bosw., 200; 5 Duer, 654; 30 How. Pr., 1). So that there was no demurrer upon the record at the time the motion to strike it out came on for argument, and the notice of motion for judgment upon it therefore went for naught (Ostrander agt. (Con*283key, 20 Hum,, 421). The defendant’s right to amend was absolute, subject to the power of the court to strike out for cause shown, and when the demurrer legally disappeared from the record, the motion directed against it in consequence abated. The provision contained in section 542 of the Code of Civil Procedure, in regard to striking out the pleading so amended, means that the plaintiff may, upon proof that the amendment was interposed for delay, make an independent motion to the court for an order striking the amended pleading from the record. If the amended pleading be stricken out, the parties are returned to their former position, and the original pleading is then open to the motion originally made against it. This is the true practice to be pursued in such cases. Hot having been followed in the present instance, the motion to set aside the order entered by the plaintiff striking out the demurrer and ordering judgment for the plaintiff must be set aside, but without costs.