A state hospital once used as an insane asylum has triggered one of the most contentious development battles in Silicon Valley, with officials on both sides of the deal calling each other crazy - and more. "It was a sweetheart deal and there was a lot of yelling over it," said Eddie Souza, former Santa Clara mayor. Sun Microsystems is building new corporate headquarters on 82.5 acres it bought from the state for $52 million. The high-tech company's digs will rise on a portion of the former Agnew Development Center, which lies at the north end of Santa Clara across the Bayshore (101) Freeway. which divides the north and south parts of Santa Clara. "This is a model of private/public partnership," said Bill Agnello, Sun's vice president of real estate and the workplace. "A lot of people said we got a great deal, but they don't understand how corporate developers pay for land." Located at Lafayette Street and Montague Expressway, the Agnew site boasts some open land, R&D facilities, and housing developments that are underserved compared with the south end of town. There are no public libraries, parks, police or fire stations, let alone shopping mall. Sun and its supporters said that the Sun project would help attract these amenities to the area But Sun had to battle numerous groups over destroying Agnew, a Beaux Arts complex built in 1888 whose 60 buildings featured tiled roofs, marble floors, and Mediterranean-style flourishes. Its elegant clock tower holds an original Seth Thomas timepiece; some rooms sported shoulder-high wainscoting. And quite apart from the preservation issue, opponents of the project argued that a new library and supermarket were already on the way whether Sun moved in or not. The 330-acre site was landscaped by John McLaren the longtime superintendent of Golden Gate Park. Some 1,300 trees had been planted to shade the asylum's retarded, mentally ill and disabled residents, who farmed the surrounding land. The complex thrived until the 1960s, when the state's commitment to the mentally ill dwindled. By 1995, Agnew had deteriorated so much that it flunked requirements for continued federal funding "The state had to make a decision," said Geoff Goodfellow, Santa Clara planning director. The state moved Agnew's 800 residents to a smaller facility, then closed Agnew's Santa Clara campus. "The state was supposed to sell (Agnew's) for fair market value, although there is legislation that can force them to use it for open space or affordable housing," Goodfellow said. Instead, the state held a confidential auction in which it collected 200 sealed proposals for the site. Sun, which would demolish most of Agnew's buildings and construct its own facility, was the only high-tech finalist. The state sold Sun that portion of land where the buildings were clustered. Out of the $51 million purchase price, Sun would spend $17 million for renovation of a few buildings which would not be demolished. The state will reimburse Sun for the cost of renovation, so the net purchase price was $34 million. Critics point out that Sun paid a net of $412,000 per acre, a fraction of the then-market value of $1.5 million per acre for land in this coveted area. (Sun responded that a lower price was appropriate because it plans to build at a low floor-area-ratio of 0.28.) Neither former mayor Souza nor current city councilwoman Pat Mahan, a lawyer, could explain the state's secretive process. "I had some concerns about it," said Mahan. "But by the time the city got the (Sun) project, it was done deal." Representatives of the state Department of General Services did not return repeated telephone calls. In December 1996, the state presented the Santa Clara City Council with the done deal. "Either you accept the deal with Sun, or not at all," Mahan said the council was told. Many citizens and officials unsuccessfully tried to convince Sun to swap the historic site with vacant land next door. Santa Clara's planning commission rejected Sun's project 4-3, but the City Council ignored staff recommendations and approved the project 4-3. Then began a complicated two-tiered environmental review process that made planning difficult, said Goodfellow. Planners had to draft an EIR for Sun's project, and another for the remaining 248 acres. Meanwhile, citizens galvanized to stop Agnew's demise. One group registered the 330-acre site as a national historic district in August 1997 - making it the only such historic district in Northern California. "We thought the move would save those buildings," said organizer Liz Holmes. But because a private - not public - entity was doing the razing, the buildings weren't spared. Then, a second citizens group filed a lawsuit against the city, attacking its EIR. The citizens lost but appealed." The delays were costing us a lot of money in stalled construction costs," said Agnello. So, Sun offered to pay the citizen's legal fees if they'd drop the matter; they did. Meanwhile, a third grassroots group collected enough signatures to put Sun's project to a public vote. To defeat Measure D, Sun mounted a well-defined public relations campaign, mailing 14 different pamphlets and spending at least $500,000. "We tried not to make it too glitzy," said Agnello. "Yet, we explained our position, which was we would preserve some buildings, have open space and stimulate development on that side of the city." In June, 64% of Santa Clara voters strongly backed the Sun project. However, bad blood boiled into November, when Santa Clara held its municipal elections. Sun's project became a campaign issue although voters did not cast ballots along Sun lines. Both Mayor Judy Nadler - who supported the Agnew project - and Councilwoman Mahan - who opposed it - won reelection by wide margins. Sun has since tried to appease critics and provide public needs. It will save three buildings as well as part of the clock tower, which will become Sun's reception area. The three buildings will be shared with the public, while an adjacent 14.5-acre grassy field will become a park. Sun will spend $220 million building a low-density, low-rise campus, said Agnello. For its part, the state will pay for a homeless shelter and a child-care center on site. Agnew's remaining 248 acres will become a housing development with a mix of single-family, low-income housing, and senior housing. Prior to Sun's arrival, the city had already started to bring a supermarket chain and public library to the area. "But now the question is how we'll fund a new school and park," said Goodfellow. There are many lessons to learn from the experience, said Mahan. "The major one is you have to figure out a way to be pro-active in planning." In this case, she regrets that the state didn't involve the city earlier in the process. "I wish there had been an opportunity for the city to say to the state, 'Look, this is what we need, let's work together on this.' "But that never happened." Contacts: Bill Agnello, vice president of real estate and the workplace, Sun Microsystems, (650) 934-9651. Geoff Goodfellow, Santa Clara director of planning, (408) 261-5260. Pat Mahan, Santa Clara City Councilwoman, (408) 237-1055. Eddie Souza, citizen, (408) 984-6037.