The private foundations pledging to help finance raises and bonuses for D.C. teachers have placed themselves in the middle of the city's mayoral race with one of the conditions for their largesse: If Schools Chancellor Michelle A. Rhee leaves, so could the money.

The private donors have told the District that they reserve the right to reconsider their $64.5 million pledge if leadership of the school system changes, further complicating a proposed labor contract that has generated controversy since Rhee and union leaders announced it this month.

That clause, yet to be publicly discussed by D.C. officials, is a standard feature of private grants. But it comes at the beginning of a primary campaign that could leave Rhee out of a job. Mayor Adrian M. Fenty (D) has staked much of his campaign on evidence of Rhee's success in improving schools. His opponent, D.C. Council Chairman Vincent C. Gray, has sent mixed messages about retaining Rhee, telling reporters after his campaign kickoff Saturday that school reform and Rhee's presence are "not inextricably tied."

Nor is it known whether Rhee would agree to serve in a Gray administration. She did not respond to e-mailed requests for comment Tuesday.

Should the foundations pull their funding after the agreement is finalized, the District could be liable for at least $21 million -- the amount of private money earmarked to pay teacher salaries. According to the contract, the Washington Teachers' Union could sue the city or seek arbitration for breach of contract.

The leadership condition, set out in letters to District officials from the Walton Family Foundation, the Robertson Foundation, the Laura and John Arnold Foundation and the Broad Foundation, could also be a deal breaker for D.C. Chief Financial Officer Natwar M. Gandhi, who must certify that the money promised in the contract is available before the pact is approved by union membership and the D.C. Council.

Gandhi, who is expected to deliver his formal analysis of the contract this week, said Tuesday through a spokesman: "The government has to be assured that the money it is getting is without condition. We cannot spend money that we are not certain of. This is one of the issues that have made this analysis such a lengthy and difficult process."

The leadership question is the latest uncertainty to emerge around the contract. Unveiled to great fanfare, it was hailed by union and D.C. leaders as a groundbreaking agreement affirming the importance of teacher performance over seniority. It features a performance-pay provision for teachers who meet certain criteria, including growth in student test scores.

New questions about the financing of the agreement surfaced unexpectedly this month when Rhee announced that she would fund part of the teacher raises with a $34 million surplus in the schools budget. Two days later, Gandhi said such a surplus did not exist. Rhee responded by saying that another $29 million had been "identified" to support the pact. Gandhi's and Rhee's staffs have been working to clarify the funding picture.

Foundations have for years donated hundreds of millions of dollars to education projects across the country, including the District. What makes private money so controversial in this case, experts say, is that it is so extensively embedded in a collective bargaining agreement.

About a third of the $64.5 million is projected to pay for a portion of the five-year, 20 percent teacher pay raise that the union and District negotiated. The total financial package would increase the average salary of an educator from about $67,000 to $81,000, placing it near the top of the region's pay scale, according to the American Federation of Teachers.

Most of the balance of the private funding would also support the performance-pay program. But these funds are not built into the contract and are less of a concern to Gandhi.

The total cost of the contract, including public dollars, is about $140 million.

Such a pay increase would be difficult to match in today's economy if the District had to rely on its own resources. But it also means that teachers face the possibility of losing a portion of their raise if Rhee leaves.

Union President George Parker said his sole concern is Gandhi's analysis of the contract. If he judges it to be fiscally sound, it is incumbent on the city to live up to it, regardless of what happens to Rhee, he said.

"We don't have an agreement with the funders. We have an agreement with the city," Parker said. "It is up to the CFO to say whether it has the money."

Other conditions set by the foundations are potentially problematic because of the leadership clause. They include fiscal certification -- about which Gandhi has expressed doubts -- and ratification by the teachers' union membership, which can happen only after certification.

The foundations set out their conditions in letters last month to Rhee and Cate Swinburn, president and executive director of the D.C. Public Education Fund, the nonprofit organization established by political supporters of Fenty's to raise and funnel private contributions to the public schools. Although the four foundations differ on some conditions, all insist on stability at the top of the school system.

"The Foundation reserves the right to discontinue support for this initiative if there is a material change in DCPS' leadership." wrote Buddy D. Philpot, executive director of the Walton Family Foundation, in a March 17 letter to the D.C. Public Education Fund. The D.C. nonprofit shared the letters with The Washington Post at the newspaper's request.

Walton is the largest single donor, promising $25 million. Robertson has pledged $19.5 million, and Arnold and Broad have promised $10 million each.

The foundations also expect growth in test scores and teacher retention. "In the case that the anticipated outcomes are not being realized, the third party funders reserve the right to reconsider their support," Swinburn wrote to Rhee on March 30.

Swinburn said the achievement targets match those in the District's application to the federal Race to the Top grant competition. These include 5 percent annual growth in reading and math proficiency on the DC-CAS and a 10-point rise on the National Assessment of Educational Progress.

Swinburn said the conditions are "standard for private foundation grant agreements." She said Tuesday that she has never faced a situation in which foundations have rescinded grants for not meeting such conditions.