At the Mount Pleasant Neighborhood Library in Northwest Washington, steam pipes are leaking, paint is peeling, windows are nailed shut and carpets are stained. For several days last month, the building was closed because the heat wasn't working.

Chief Librarian Ellen E. Kardy has a 15-page plan to renovate the 79-year-old building, but year after year the city fails to fund the $6 million facelift.

In a remarkable turn of events, however, the District's 27-branch public library system suddenly stands to reap $45 million -- enough to build eight libraries or renovate 17. It's an unimaginable windfall for an agency whose operating budget is $29 million.

And it will be made possible only if the D.C. Council approves a plan offered by Mayor Anthony A. Williams (D) that has polarized the city: using hundreds of millions of public dollars to build a baseball stadium along the Anacostia River in Southeast.

The money for libraries is the centerpiece of an evolving community investment package that has been added to the legislation. Other neighborhood perks, negotiated by D.C. Council members, include $5 million for a sports and learning complex in Ward 8, $2 million for laptop computers for students at McKinley Technology High School and $10 million to develop plans for a hospital.

During the past month, as the merits of a stadium have been debated, Williams and his allies have contended that the ballpark will spawn investment across the city. Stadium opponents, meanwhile, have countered that the neighborhood benefits will be minimal and that the project will draw resources from more pressing needs.

But for some who stand to gain immediately, the impact is clear: Like it or not, talk of a new stadium has created a political climate that could bring money for long-dormant projects.

"Trying to fix everything here drives me crazy because it takes so much time out of my day," Kardy said on a recent morning as workers banged on leaking pipes. "Sometimes it's sad to think that it takes a baseball stadium to bring the money, but if so, I guess I'll take it."

Chris Bender, a spokesman for Williams, said that "people spoke of the need to make sure there was an equal investment between baseball and basic community needs. We found a legislative way to do that and did it."

Yet many civic activists believe the community investment package is an insufficient trade-off for a public stadium project.

"I feel the council members should not be bought for that low price," said Ahmed Assalaam, a Ward 6 activist who is angry that the city has yet to build a hospital east of the Anacostia River after closing D.C. General several years ago. "All these years you tell me you can't afford a hospital, and now you find all the money you've been looking for all this time for a baseball stadium?"

These competing points of view have had some council members wrestling with their consciences, trying to decide at what price they will sign on to the mayor's plan.

Williams has proposed paying for the stadium, estimated by various city officials to cost $440 million to $584 million, through a gross receipts tax on large businesses, a concession tax and an annual rent payment by the team.

When Williams revealed the plan in September -- shortly after Major League Baseball announced that it would move the Expos from Montreal to Washington -- there was no community investment fund attached.

But after protests from civic activists and council members, Williams instructed his staff to develop a way to bring additional investments to neighborhoods. Aides settled on a plan to create a special district around the ballpark and to allocate tax money from businesses in that district to neighborhood projects, a concept known as tax-increment financing.

The plan, aides said, could generate up to $450 million after the stadium is built in 2008. Council members immediately brought their ward wish lists to the administration.

Vincent B. Orange Sr. (D-Ward 5) said he asked for $150 million for a hospital on the site of D.C. General, before settling for the $10 million hospital study and $2 million for McKinley Tech.

"I would always have voted for baseball, but when the community benefit package came along, I looked at the needs of community, and that's one of the needs that I saw and wanted allocated," Orange said.

Sandy Allen (D-Ward 8) was concerned that her constituents have been largely left out of the city's recent economic renaissance. So she took her cause to the mayor and got $40 million for economic investment along major Ward 8 avenues, as well as the $5 million to build a sports and learning center.

Barry Hunter, who coaches a youth boxing team at the Bald Eagle Community Center in Ward 8, was thrilled. His team shares a cramped space with many other programs, and he longs for a computer lab where his team can do homework.

"We do not want to lose kids to the streets based on the facility we have," Hunter said.

But some activists said the administration is making promises that will not be kept. They say the tax-increment financing district would not generate enough revenue to raise bonds of $450 million because economists have said that stadiums generally do not draw significant development.

"The money set aside for baseball is real, but the money set aside for other things may not be," said Ed Lazere, co-leader of a group that opposes using public funds for the stadium.

Even the D.C. Library Renaissance Project, founded by Ralph Nader and run by Leonard Minsky, opposed the mayor's community investment package. Minsky issued a news release saying that although money for libraries is important, the city should not build the stadium with public money and instead should invest in more social programs.

Stadium opponents point out that although administration officials say the ballpark will create revenue, the mayor is using $30 million already in city coffers to help launch the community investment fund. That money could be used for neighborhood projects regardless of whether a stadium is built, the activists said.

Bender described the $30 million as "seed money" that will give the city time to build the stadium and attract businesses whose tax money will increase the community fund exponentially.

Furthermore, Bender stressed, the $30 million was not taken from already budgeted programs. Rather, he said, half was surplus revenue from last year, and the other half was money the federal government had until recently forced the District to keep in reserve.

Jim Graham (D-Ward 1) has been perhaps the most conflicted council member. Lobbied hard by Williams aides who saw him as a key seventh vote, Graham came on board only after the administration promised to give $45 million to the libraries.

Graham insisted that the city use a more secure revenue stream to pay for his pet project than the tax-increment financing district. To appease him, the administration agreed to increase the gross receipts tax on large businesses by $2 million a year and use that to pay debt service on $45 million in bonds.

Graham bristles at the notion that the mayor bought his vote.

"This not a Christmas tree," Graham said. "But you have a baseball stadium, which it's clear to everybody that I do not have that much independent enthusiasm for, and I saw this as opportunity to really leverage it."

Leslie Mtewa, center, manager of Francis A. Gregory Neighborhood Library in Southeast, discusses needed repairs. Libraries would get $45 million of community investment package.