Defendants, partners in tbe contracting business, were engaged in work on a government flood control plan at Council Bluffs in tbe fall of 1946. They applied for and-obtained a license to build a private crossing over tbe tracks of plaintiff-railway for tbe purpose of hauling heavy equipment across the tracks. In accordance with the written agreement between plaintiff and defendants, plaintiff assigned one Stewart to protect train and vehicular movements over the crossing. On October 31, 1946, Stewart was seriously injured by a six-wheel dirt mover operated over the crossing by Orr, an employee of defendants engaged in the construction work.
Stewart was immediately taken to a Council Bluffs hospital where he was confined four months. Without defendants’ knowledge plaintiff engaged the necessary hospital, nursing and medical care for Stewart of the reasonable value of $2661.62 which plaintiff paid. On December 10, 1946, plaintiff made written demand on defendants for reimbursement for this hospital, nursing and medical expense but defendants declined to reimburse plaintiff therefor.
After plaintiff commenced this action on January 14, 1948, to recover the $2661.62 from defendants, Stewart commenced action against both plaintiff and defendants herein, claiming damages of $150,000 because of his injuries. Both plaintiff (railway) and defendants (construction- company) herein filed answers denying liability in the action brought by Stewart. On June 7,1949, the action by Stewart was compromised and settled by payment on behalf of defendants herein of $20,000 to Stewart and his wife, who executed a release of all claims held by Stewart against plaintiff and defendants herein, and that action was dismissed with prejudice.
The written agreement between plaintiff and defendants under which plaintiff granted defendants a license to construct and use the private crossing provides in part that plaintiff will furnish conductors to be located at points designated by it to protect both train and vehicular movements over the crossing. It also contains this vital paragraph:
*947“The Licensee [defendants] assumes and agrees to pay for all loss or damage to property and injury to or death of persons, including costs and expenses incident thereto, arising, wholly or in part, from or in connection with the existence, * * * maintenance, * * * use or removal of said facility or any defect therein or failure thereof, causing same or contributing thereto; and the Licensee shall forever indemnify the Railway Company against and save it harmless from all liability for any such loss, damage, injury and death, including all costs and expenses incident thereto.”
Plaintiff contends and the trial court held the quoted provisions contain (1) an indemnity agreement following the semicolon and (2) an agreement to pay all costs and expenses incident to any personal injury arising from use of the crossing, and that defendants were liable to plaintiff under the provision last referred to. Defendants contend plaintiff cannot recover for the reason it does not appear plaintiff was legally liable to Stewart for the expense incurred by it and its payment of such expense was voluntary and gratuitous.
The case turns mainly on the proper construction of the quoted language of the agreement. It must be conceded that if it provides merely for indemnity to plaintiff from liability for loss, damage or injury, plaintiff cannot recover because it does not appear it was legally liable for the expense paid by it except as it voluntarily assumed such liability. An agreement for mere indemnity from liability ordinarily covers only legal liability and not liability such as the indemnitee voluntarily assumes. Defendants have cited several authorities that sustain this proposition and plaintiff does not challenge it.
Except for one case where there was no contract for indemnity but the right thereto was based on the relationship between the parties, every precedent cited by defendants under its first and third brief points involves a contract for indemnity only. As above indicated, plaintiff contends the agreement here is more than one for mere indemnity and has cited decisions that measure the rights of the parties by the terms of the particular contract.
The meaning of the quoted language should be gathered *948from the whole paragraph. If reasonably possible, effect will be given to all the language. Hubbard v. Marsh, 241 Iowa 163, 166-168, 40 N.W.2d 488, 490, 491; Nylander v. Nylander, 221 Iowa 1358, 1360, 268 N.W. 7, 8; Hipwell v. National Surety Co., 130 Iowa 656, 662, 105 N.W. 318; Laevin v. St. Vincent De Paul Society of Grand Rapids, 323 Mich. 607, 36 N.W.2d 163, 164, 6 A. L. R.2d 815; 12 Am. Jur., Contracts, section 241, pages 772-775; 17 C. J. S., Contracts, section 297, pages 710, 711. A like rule is a cardinal rule of statutory construction.
“Bach contract must be construed according to its own terms.” Duke v. Tyler, 209 Iowa 1345, 1348, 230 N.W. 319.
The clause which follows the semicolon provides for complete indemnity to plaintiff from the liability therein referred to. If, as defendants contend, the only purpose of the quoted paragraph was to provide for such indemnity to plaintiff, the language at the beginning of the paragraph is useless surplus-age. We think it is reasonably possible to give effect to such language.
The agreement states: “The Licensee assumes and agrees to pay for all * * * injury to * * * persons, including * * * expenses incident thereto, arising, wholly or in part, from or in connection with the existence, * * * maintenance, * * * use or removal of said facility * * This provides for more than mere indemnity to plaintiff. It is an absolute promise to assume and pay the necessary and reasonable expense plaintiff' seeks to collect. Hipwell v. National Surety Co., supra, 130 Iowa 656, 660, 105 N.W. 318, 319.
In the Hipwell case, supra, the agreement provided “ ‘that the party of the second part further covenants and agrees to promptly pay for all labor and materials used in and about the building, and to hold and save the said first party harmless from and against all and every demand * * ” We held “in no plainer language could the contractor have agreed ‘to promptly pay for all labor and materials used in and about the building.’ ”
State v. Cordaro, 214 Iowa 1070, 1075, 241 N.W. 448, 450, states: “A contract to indemnify and save harmless is. quite a different thing from an unqualified and absolute promise to *949pay.” To tbe same effect are Wicker v. Hoppock, 6 Wall. (U. S.) 94, 18 L. Ed. 752; 42 C. J. S., Indemnity, section 3. For a ease involving an agreement to indemnify and also to assume a contract see Mills v. Allen, 133 U. S. 423, 10 S. Ct. 413, 33 L. Ed. 717.
Although the case is factually not in point we think this language from Hilliard v. Newberry, 153 N. C. 104, 107, 68 S.E. 1056, 1057, is applicable here: “* * * the authorities are to the effect that, when a collateral obligation is in strictness one of indemnity, an action at law will not lie unless and until some actual loss or damage has been suffered, but, when the obligation amounts to a binding agreement to do or refrain from doing some definite, specific thing materially affecting the rights of the parties an action will presently lie for breach of such an agreement, and no damage need be shown. * * * ‘Where the promisor has undertaken to do a particular act or make a specific payment as well as to indemnify the promisee, the contract is broken, and a recovery for such breach may be had as soon-as the time for doing such act or making such payment has arrived, and the-promisor has failed to perform his obligations, and in such ease it is no defense that the promisee has not been damnified.’ ”
See also Wicker v. Hoppock, supra, 6 Wall. (U. S.) 94, 18 L. Ed. 752; In re H. L. Herbert & Co., 2 Cir., N. Y., 262 F. 682, 684; Liberty Mutual Ins. Co. v. Atlantic Coast Line R. Co., 66 Ga. App. 826, 19 S.E.2d 377, 382; 42 C. J. S., Indemnity, section 3, page 566.
The agreement quoted last above seems to have been intended not merely for plaintiff’s protection but also for the benefit of persons injured from use of the crossing. There is little doubt that Stewart, had he seen fit, could have recovered these expenses from defendants by virtue of the agreement. Curtis v. Michaelson, 206 Iowa 111, 119, 219 N.W. 49; Haakinson & Beaty Co. v. McPherson, 182 Iowa 476, 477, 166 N.W. 60; Hay v. Hassett, 174 Iowa 601, 605, 156 N.W. 734; Hipwell v. National Surety Co., supra, 130 Iowa 656, 661, 105 N.W. 318; Wells v. Kavanagh, 70 Iowa 519, 30 N.W. 871; Jordan v. Kavanaugh, 63 Iowa 152, 158, 18 N.W. 851 (holding the statutory *950rule in effect since tbe Code of 1851, now stated in rule 3, Rules of Civil Procedure, applies to a bond given a railroad. Curtis v. Michaelson, supra, is a like bolding as to a contract given a bus operator.); Fidelity & Deposit Co. v. Rainer, 220 Ala. 262, 125 So. 55, 77 A. L. R. 13, 20, and annotation 21, 56, 65; annotation 81 A. L. R. 1271, 1279; 17 C. J. S., Contracts, section 519c, page 1121; 12 Am. Jur., Contracts, section 277. See also Eggermont v. Central Sur. & Ins. Corp., 236 Iowa 197, 17 N.W.2d 840.
Rule 3, Rules of Civil Procedure, above referred to, provides: “Public bond. When a bond or other instrument given to the state, county, school or other municipal corporation, or to any officer or person, is intended for the security of the public generally, or of particular individuals, action may be brought thereon, in the name of any person intended to be thus secured, who has sustained an injury in consequence of a breach thereof, except when otherwise provided.”
Haakinson & Beaty Co. v. McPherson, supra, states (at page 477 of 182 Iowa) : “* * * no matter to whom a bond runs, if the contract which it secures contains a provision that certain things shall be done for parties not named in the contract, then a breach of that agreement gives these other parties the right to sue and recover upon the bond.”
Here this expense was incident to Stewart’s injury from use of the crossing, it was necessary and reasonable, defendants refused to pay it as they had agreed to do. Thus there was a breach of the agreement. Hipwell v. National Surety Co., supra, 130 Iowa 656, 663, 105 N.W. 318.
Not only could Stewart have enforced the agreement had he seen fit, but this plaintiff is entitled to do so. Rule 2, Rules of Civil Procedure, superseding a statute of like effect in force since the Revision of 1860 (section 2758), states: “* * * a party with whom or in whose name a contract is made for another’s benefit * * * may sue in his own name without joining the party for whose benefit the action is prosecuted.”
Our conclusion that plaintiff is entitled to enforce the claim here asserted finds further support in Turnis v. Ballou, 201 Iowa 468, 472, 205 N.W. 746; Linnemann v. Kirchner, 189 *951Iowa 336, 339, 178 N.W. 899; Smith v. Continental Ins. Co., 108 Iowa 382, 385, 79 N.W. 126; Ingelson v. Olson, 199 Minn. 422, 272 N.W. 270, 110 A. L. R. 167, 171; 12 Am. Jur., Contracts, section 273; 17 C. J. S., Contracts, section 519c(4), pages 1139, 1140.
The basic rule for the construction of all contracts is to ascertain the intention of the parties and give it effect if that can be done consistently with legal principles. Darnall v. Day, 240 Iowa 665, 670, 37 N.W.2d 277, 280, and citations; annotation 175 A. L. R. 8, 29; 42 C. J. S., Indemnity, section 8a; 27 Am. Jur., Indemnity, section 13. We think our decision gives effect to the intention of the parties and does not violate any rule of law.
Defendants desired to use property belonging to plaintiff in the performance of their contract with the government. Plaintiff was not compelled to grant defendants a license to construct and use this crossing. So far as shown, it was not paid for doing so. Plaintiff was entitled to impose such conditions as it chose upon granting permission to use its property. There is nothing unreasonable or unjust about the construction we have given the agreement.
Defendants suggest in argument that plaintiff is precluded by the language of its petition from contending the agreement is not strictly one of indemnity. The argument is based on the allegation of the petition “That defendants, under the terms of the indemnifying provisions of the license agreement * * * are obligated to repay plaintiff $2661.62.”
We cannot accept defendants’ suggestion. To do so would be to construe the petition with too much strictness and technicality. The license agreement, copy of which is attached to the petition, fills five pages of the record and covers several matters not referred to herein. The entire paragraph of the agreement heretofore quoted is set out in the petition proper. The petition as a whole does not indicate an intention to rely solely on the provision of the agreement merely for indemnity rather than upon the entire paragraph. The language of the petition on which defendants rely may well have been intended as a reference to the whole paragraph.
*952The foregoing is deemed, a sufficient answer to the sole error upon which defendants rely for reversal. Defendants do not argue they are entitled to a reversal by reason of the release signed by Stewart and wife or the dismissal of the tort action brought by him while the present action was pending.— Affirmed.
Shith, C. J., and Bliss, WeNNErstruM and LARSON, JJ., concur. Hays, MulRONEy and THOMPSON, JJ., dissent. Oliver, J., takes no part.