
37 Cal.2d 808 (1951)
MANUEL REACHI, Appellant,
v.
NATIONAL AUTOMOBILE AND CASUALTY INSURANCE COMPANY OF LOS ANGELES, Respondent.
L. A. No. 21766. 
Supreme Court of California. In Bank.  
Oct. 19, 1951.
 Guy E. Ward and Kenneth D. Holland for Appellant.
 Harry A. Franklin for Respondent.
 EDMONDS, J.
 Manuel Reachi is claiming damages assertedly sustained by him in clearing title to real property from the lien of an attachment which was wrongfully obtained. *810 His appeal is from a judgment which followed an order sustaining the surety's demurrer to the complaint without leave to amend.
 At the time the attachment was issued, Reachi alleges, he was a resident of Mexico City and the owner of certain land in Los Angeles. Damages assertedly caused by the negligence of Reachi in making an excavation upon his land were claimed by the adjoining owner. He filed a bond executed by the respondent surety, and obtained a writ of attachment. The writ was levied on Reachi's property pursuant to section section 537, subsection 3, of the Code of Civil Procedure.
 Reachi did not move to set aside the levy or recall the writ but, following a trial of the action on the merits, judgment was rendered in his favor. That judgment is now final. As he states the situation in his complaint, "all of the proceedings, pleadings and documents with respect to the levy of said attachment were valid and regular on their face and for that reason ... [he] ... made no motion nor brought any proceeding to discharge or dissolve said attachment, as said motion or proceeding would have been unsuccessful and an idle and futile act, and the only manner by which said attachment could be dissolved or discharged was to defend and win the above mentioned action on its merits."
 To defend the action, Reachi alleges, it was necessary for him to travel from Mexico City to Los Angeles to testify at the trial at an expense of $1,500, and to incur liability for attorney's fees of $2,500. According to the complaint, the issues to be tried required him to employ a licensed surveyor who charged $505 to make an examination of the excavation and the alleged damage caused by it, prepare maps, exhibits, blueprints and other documents, and testify at the trial. Reachi alleges that, after demand, payment of these sums has been refused by both the plaintiff in the principal action and by the surety.
 The demurrer of the surety was sustained without leave to amend and judgment entered accordingly. As grounds for reversal of the judgment Reachi contends that, because the gravamen of the present action is a wrongful attachment, he is entitled to the expenses necessarily incurred by him in clearing his title of the attachment. He admits that, ordinarily, attorney's fees incurred in defense of the principal suit, as distinguished from those paid for procuring a dissolution of an attachment, are not recoverable as an item of damages. However, he contends that where the attachment is regular on *811 its face and the wrongfulness of the levy can only be shown in a trial upon the merits, attorney's fees are allowable.
 The surety contends that the decisions in this state limit the recovery of attorney's fees to those paid in proceedings to vacate the attachment, and do not allow one to have judgment for the cost of the defense of the principal suit. Furthermore, argues the surety, the complaint does not show that attorney's fees were paid. The traveling expenses are challenged as unnecessary. Reachi's testimony, it is said, could have been taken by deposition; a party to a suit is not entitled to witness fees or mileage for attending a trial, and "his presence must be referred to his natural interest as a party to the litigation." The claim for expenses incurred in the employment of the surveyor is attacked upon the ground that fees paid to an expert witness may be taxed as costs only when he has been appointed by the court, and no such order is pleaded as having been made.
 In accordance with the provisions of section 539 of the Code of Civil Procedure, the undertaking guarantees payment of "... all costs that may be awarded to the said defendants, or any of them, and all damages, which they, or any of them may sustain by reason of the said attachment. ..." The parties agree that the measure of damages in an action on an attachment bond is the actual expense and loss necessarily and proximately caused by the levy. But the surety, in effect, argues that attorney's fees incurred in the defense of the principal suit can never be regarded as having been proximately caused by the attachment levy. There is no support for this position either in logic or legal principles.
 Although there are several decisions by the courts of this state denying the recovery of counsel fees paid in defense of the principal suit (Miramonte & Louedestel Co. v. National Surety Co., 91 Cal.App. 64 [266 P. 576]; Soule v. United States Fidelity & Guaranty Co., 82 Cal.App. 572 [255 P. 886], and see cases cited and discussed therein), material factual differences distinguish them from the situation shown by Reachi's complaint. In none of those cases did the plaintiff allege or prove that the writ of attachment was regular on its face and, for that reason, not subject to a motion to vacate or dissolve it.
 [1] As stated in Thropp v. Erb, 255 N.Y. 75 [174 N.E. 67, 71 A.L.R. 1455], "If a defendant instead of making such a motion chooses to appear generally in an action and to defend it on the merits, his appearance may be for the dual purpose *812 of getting rid of the attachment and of disposing of the issues; but he can hardly assert that his defense on the merits was for the purpose of disposing of the attachment and that expenses incurred in such defense were 'damages sustained by reason of the attachment' where the defendant might have rid himself of the attachment without such defense and without incurring such expenses." Accordingly, legal expenses incurred in defense of the principal suit, under such circumstances, are not allowed because they were not primarily and necessarily incurred for the purpose of obtaining an order vacating the wrongful levy.
 [2] In the present case, however, it is alleged that "all of the proceedings, pleadings and documents with respect to the levy of said attachment were valid and regular on their face" and that a motion to discharge the attachment "would have been unsuccessful and an idle and futile act, and the only manner by which said attachment could be dissolved or discharged was to defend and win the ... action on its merits." This was the factual situation in Thropp v. Erb, supra, and the following comments of the court are equally applicable here: "Without proof that a defendant has used every remedy open to him to dispose of an attachment without a trial on the merits, the chain of causation from the warrant of attachment to the expenses incurred in a trial on the merits may at times be incomplete. In the present case there would have been no 'reasonable chance of success' if a motion had been made to vacate the warrant. No contention can be seriously raised that this plaintiff could have rid himself of the warrant of attachment except by a trial on the merits. No futile motion to vacate was necessary to complete the chain of causation between the warrant of attachment and the expenses incurred in the successful defense." Accordingly, it was concluded that: "In each case the question of whether the defense on the merits was the result of the warrant of attachment must depend upon the circumstances of that case. Where that is established the expenses of the defense on the merits may be recovered in an action upon the statutory undertaking as damages sustained by reason of the attachment." Similarly it was said in Moesley v. Fidelity & D. Co., 33 Idaho 37 [189 P. 862, 25 A.L.R. 564], that attorney's fees are a recoverable item of damages "... where a trial of the principal action was necessary to dispose of the attachment." [3] As stated in 5 American Jurisprudence 215, where the cases are collected: "The majority view is that recovery of expenses for defending *813 the attachment or garnishment suit on its merits is proper where it is necessary to defeat the main action in order to defeat the attachment." (Additional decisions are cited in the annotations in 25 A.L.R. 579, 692, and 71 A.L.R. 1458, 1462.)
 [4] The foregoing principles are applicable to the other items of damages claimed by Reachi. (Moesley v. Fidelity & D. Co., supra, travel expenses allowed; Olsen v. National Grocery Co., 15 Wn.2d 164 [130 P.2d 78], expenses incurred in employment of a marine architect allowed.) Concerning the claim for traveling and hotel expenses incurred in attending and testifying at the trial, the surety argues that they were unnecessary because the testimony might have been taken by deposition. But the necessity and reasonableness of all expenses--attorney's fees, travel costs, and the charges made by the expert witness--can be determined only with the other issues of fact upon a trial.
 The decision in Beal v. Stevens, 72 Cal. 451 [14 P. 186], cited by the surety, does not preclude the recovery of travel expenses as an item of damages. The Beal case was one to foreclose a mortgage and the court properly held that a statute allowing witness fees and mileage did not apply to a party to the action. The present action is upon an undertaking which guarantees the payment of all damages sustained by reason of the attachment, and the complaint alleges that Reachi was "obliged" to incur those expenses in order to vacate the attachment.
 [5] The final item of damages claimed is the expense incurred because "it was necessary ... to employ a licensed surveyor to make an examination and investigation into the facts relating to said excavation and alleged damage and to prepare certain maps, exhibits, blue prints and other documents and to testify in the trial of said cause as an expert witness." The surety contends that this item is improper because "fees paid to an expert witness may be taxed as costs only where the expert has been appointed by and under the direction of the Court."
 However, this expense is not sought as an item of allowable costs, but as damages necessarily incurred in obtaining the release of the attachment by the successful defense of the action on the merits. As was stated in Olsen v. National Grocery Co., supra, where such expenses were allowed, "The basis of the rule appears to be whether the expenses incurred were reasonably necessary for the preparation and conduct *814 of the trial." Whether or not his services and testimony were necessary is to be determined, with the other factual issues, on the trial.
 [6] The surety's final contention is that the complaint is defective in that it does not show that the attorney's fees were paid. It is true that the complaint only alleges that such expenses were "incurred," and it has been held in this state that such an allegation is insufficient. There is no logical reason for such a rule and it is contrary to the conclusions reached in all other jurisdictions in this country. (See cases collected in 25 A.L.R. 597-598; 71 A.L.R. 1463.) Insofar as they hold that payment of counsel fees is a condition precedent to their recovery as an item of damages for wrongful attachment, Elder v. Kutner, 97 Cal. 490 [32 P. 563]; Prader v. Grimm, 28 Cal. 11, and Willson v. McEvoy, 25 Cal. 169, are overruled.
 The judgment is reversed with directions to the trial court to overrule the demurrer and to allow the surety a reasonable time within which to answer.
 Gibson, C.J., Shenk, J., Carter, J., Traynor, J., Schauer, J., and Spence, J., concurred.
