What worried Ed Wagner the most about exploring the gloomy cluster of abandoned Mission Revival-style buildings in a prime section of San Jose was where to park his bike.

He needed some place to lock it up. The nearby Cisco parking lot would do, but he feared Cisco security wouldn't welcome a stranger wandering about their grounds.

Wagner, 30, didn't know at the time that the decaying buildings adjacent to Cisco were originally part of an insane asylum constructed to house patients that newspapers of the early 20th century routinely described as "mad," "demented" or the tabloid-friendly "lunatics." But the size of the property in San Jose made an impression.

"It initially stuck out to me because — what was this huge, disused plot of land doing in such a valuable location?" He said in an email to SFGATE.

MORE: The Bay Area's 'ruins': 8 abandoned sites in glorious decay

The amateur photographer had stumbled on the East Campus of the old Agnews Developmental Center, formerly known as "The Great Asylum for the Insane" and the California Hospital for the Chronic Insane. The asylum was built in 1885 in what is now Santa Clara, only to be destroyed in the 1906 earthquake. Newspapers reported 117 people, including 96 inmates, were crushed to death when the main building's walls collapsed.

Hundreds of "insane persons" who survived the quake fled the grounds and roamed the countryside, the Daily Palo Alto reported. For weeks and even months, the San Francisco Chronicle and other papers ran stories of "lunatic" escapees being recaptured.

The asylum was rebuilt in 1911 as the Agnews State Mental Hospital and expanded to a second campus, the East Campus — about two miles away at Zanker and Center roads in San Jose — in 1926. The two facilities resembled college campuses, small self-contained villages of two-story Mission Revival—Spanish Colonial Revival buildings.

For almost five decades the 400-acre East Campus housed and cared for the mentally ill. In 1972, the facility — now known as the Agnews Developmental Center — changed its mission, becoming exclusively dedicated to treating and caring for patients with major developmental disabilities.

RELATED: As care shifts, developmental center to close - April 6, 2008

The center closed 10 years ago. Since then the campus has slowly fallen into disrepair. Its walls have attracted spray-paint vandals and at least one talented muralist. Its offices are trashed. Weeds have overtaken its sprawling lawns.

When Wagner happened upon the old asylum last April, it was being prepped for teardown.

"The Mission-style buildings had the eeriest atmosphere — the corridors and rooms were all dark and cramped," Wagner says. "It was enough to inspire a sense of claustrophobia."

The biggest surprise?

"Definitely the "Boardwalk" mural. It was two stories tall, but it was tucked into a courtyard. I remember feeling struck by the thought of how something beautiful was locked up where virtually no one would ever see it again, except whoever came to demolish it."

You can follow Wagner's footsteps through the old asylum in the above gallery.

Where the insane asylum complex once stood, three new schools will rise. The Santa Clara Unified School District is expected to open state-of-the-art elementary and middle schools on 67 acres of the property in fall 2020, with a high school following a year later.