
224 Cal.App.3d 1494 (1990)
274 Cal. Rptr. 626
SOUTHERN PACIFIC TRANSPORTATION COMPANY, Cross-complainant and Appellant,
v.
SANDYLAND PROTECTIVE ASSOCIATION, Cross-defendant and Respondent.
Docket No. B042000.
Court of Appeals of California, Second District, Division Six.
November 6, 1990.
*1496 COUNSEL
Griffith & Thornburgh and James F. Cote for Cross-complainant and Appellant.
Archbald & Spray and Douglas B. Large for Cross-defendant and Respondent.
OPINION
GILBERT, J.
A homeowners association and a railroad company enter into an agreement whereby the association will construct and maintain a roadway so that its members can have access to their property across the railroad's tracks. The agreement contains a clause which requires the association to indemnify the railroad for any negligence of the railroad.
Here we hold that the indemnification clause is unenforceable because Civil Code[1] section 2782, subdivision (a) makes indemnification clauses void for the sole negligence of the promisee in a construction contract. We therefore affirm the judgment in favor of the association.

FACTS
Sandyland Protective Association entered into an agreement with Southern Pacific Transportation Company to allow its members to cross the Southern Pacific railroad tracks. The agreement was signed by the president of the association in 1976. It was a successor to two similar agreements executed in 1956 and 1959 respectively.
The agreement provided that the association would construct and maintain the roadway and such signs as the railroad may designate; install and maintain gates or barricades as the railroad may require; and pay for all labor and materials. The railroad agreed to maintain existing "protective devices" at the association's expense.
The agreement contained the following clause: "[The association] agrees to indemnify and save harmless Railroad, its officers, employees, agents, successors and assigns, of all claims, liability, cost and expense, howsoever same may be caused, including reasonable attorney fees, for loss of or *1497 damage to property of either party hereto or third persons and for injuries to or deaths of ... the agents, employees or invitees of [the association] or third persons or the employees of Railroad caused by or arising out of the presence, construction, reconstruction, maintenance, use or removal of said roadway, regardless of any negligence or alleged negligence on the part of Railroad."
On September 19, 1985, Susan Fuhrer and her daughter Michelle filed suit against the railroad for personal injuries and property damage. The complaint alleged that the car in which the Fuhrers were driving was hit by a train where the association's private road crossed the tracks, and that the accident was caused by the railroad's negligent operation and maintenance of the train, tracks, crossing and signaling devices. The railroad cross-complained against the association under the indemnity clause contained in the agreement.
The association moved for summary judgment, raising various defenses including section 2782, subdivision (a). The court granted the motion based on that code section alone.
Section 2782 provides in part: "... provisions, clauses, covenants, or agreements contained in, collateral to, or affecting any construction contract and which purport to indemnify the promisee against liability for damages for death or bodily injury to persons, injury to property, or any other loss, damage or expense arising from the sole negligence or willful misconduct of the promisee or the promisee's agents, servants or independent contractors who are directly responsible to such promisee, or for defects in design furnished by such persons, are against public policy and are void and unenforceable; ..."
(1) The railroad argues that the instant "crossing agreement" is not the type of contract intended to be covered by section 2782. In support of its argument the railroad relies on section 2783 which defines "construction contract" as used in section 2782 as "any agreement ... respecting the construction ... repair, improvement, maintenance, removal of or demolition of any... road ... railroad ... or other improvement to real or personal property...." It contends section 2783 covers only agreements that have construction and maintenance as their primary purpose, and does not cover crossing agreements in which construction and maintenance provisions are "merely incidental terms."
We can find nothing in either section 2782 or section 2783 to support the distinction between "primary purpose" and "incidental terms." Moreover, *1498 even if section 2782 could be construed as covering only those contracts that have construction and maintenance as their primary purpose, the first paragraph of the agreement in question grants the association the right "... to construct, reconstruct, maintain and use a private roadway across the tracks and upon property of Railroad...." It would appear that construction and maintenance of the road are among the primary purposes of the contract.
The railroad next argues that the only duty it had under the agreement was to maintain "existing protective devices." It concludes that section 2782 prevents it from enforcing the indemnity provision only to the extent that a claim arises from the failure to maintain those devices.
We disagree. Section 2782 makes invalid indemnity clauses "... contained in, collateral to or affecting any construction contract...." We can find no indication of legislative intent to restrict the scope of the prohibition against indemnity clauses to duties arising solely from construction or maintenance performed under the contract.
It may be that a complex contract will contain an indemnity agreement that is enforceable as to matters entirely unrelated to construction and unenforceable as to matters related to construction, but such is not the case here. The duties imposed on a railroad toward people at a crossing are directly related to the construction and maintenance of the road and crossing. Section 2782 bars the shifting of ultimate responsibility for a breach of duty that is collateral to or affects the construction contract as well as for duties arising directly under contract.
(2) Finally, the railroad argues that because section 2782 only proscribes indemnity for the "sole negligence or willful misconduct of the promisee," and the plaintiffs in the underlying tort action were concurrently negligent, the indemnity clause is enforceable.
The manifest purpose of the Legislature in enacting section 2782 was to prevent one party to a construction contract from shifting the ultimate responsibility for its negligence to a nonnegligent party. That purpose would not be advanced by a construction of the statute that would allow a shifting of responsibility to a nonnegligent party upon a showing that the tort claimant and the promisee were comparatively negligent. Accordingly, we construe the phrase "sole negligence ... of the promisee" to mean that as between the promisee and the promisor, the promisee was solely negligent. Therefore, absent negligence on the part of the association, a party to the agreement, the negligence, if any, of the plaintiffs, who are third parties, *1499 is immaterial. That the plaintiffs may have been members of the association is also immaterial. The association is a corporation. The railroad cites no authority for imputing the negligence of a member to the association.
The railroad does not show, nor does it contend, that the promisor association was concurrently negligent. We therefore uphold the judgment of the trial court.
The judgment is affirmed. The respondent is awarded costs.
Stone (S.J.), P.J., and Abbe, J., concurred.
Appellant's petition for review by the Supreme Court was denied January 23, 1991.
NOTES
[1]  All statutory references are to the Civil Code unless otherwise stated.
