Bellevue — the city’s largest public hospital — has been synonymous with bedlam since it opened in 1826. The New York Times described it in the early 1900s: “It gathers the dead and dying from the rivers and streets and is kept busy night and day with the misery of the living.”

But as Pulitzer Prize winning historian David Oshinsky reveals in “Bellevue: Three Centuries of Medicine and Mayhem at America’s Most Storied Hospital,” the New York City fixture — for all of its well-known troubles — has also been at the forefront of a number of major medical movements and discoveries. As a public hospital, funded entirely by government money, Bellevue’s founding mission was to provide accessible care to every patient who crossed its threshold, whether or not they could pay. This challenge produced an institutional culture that rewarded creative thinking.

First established as an almshouse in 1816, its founders were some of the earliest advocates of the use of anesthesia in surgery, which was actually controversial when first introduced. Traditionalists worried about the long-term effects of inhaling gas; other religious types wondered if the pain that accompanied surgery was just another manifestation of divine will. Luckily for the patients and students at Bellevue, one of its most esteemed, experienced and influential faculty members, the surgeon Valentine Mott, was eager to embrace this new development in medicine. Thanks to him, the hospital became one of the first institutions in the country to use surgical anesthesia.

Another Bellevue-led development changed the landscape of emergency care in New York. It was the first hospital in the US to use ambulances. The earliest ones were tested during the Civil War, where horse-drawn wagons rushed wounded soldiers away from the battlefields. This, according to Oshinsky, gave the city’s sanitary superintendent an idea in 1869: “If thousands of wounded men could be safely plucked from the chaotic hell of Antietam and Gettysburg, surely this concept could be applied to civilian life as well.” He implemented a system of horse-drawn wagons, which carried a driver, surgeon and up to eight patients. A telegraph connected the hospital with local police precincts, and when a car was needed the stations alerted Bellevue by sounding a gong. The program was an unequivocal success. By 1924, horse-drawn wagons were replaced entirely with motor vehicles.

Bellevue was also one of the first institutions in the country to accept the wisdom of germ theory, at a moment when most American doctors were still skeptical. Surgeons regularly “held instruments in their teeth, passed unwashed artery clamps from patient to patient, and closed wounds with catgut discolored by filth,” Oshinsky writes. One surgeon named William Halsted raised funds to build a surgical tent at Bellevue where conditions were much more sanitary.

Another surgery we consider routine today was popularized at Bellevue. Dr. Lewis Sayre met a 5-year-old boy who couldn’t walk due to terrible, unexplained pain. Other doctors examined his legs and found nothing, but Sayre, tipped off by a nurse, noticed that the boy’s foreskin was so agonizingly tight that it interfered with his mobility from the waist down. After performing the procedure that cured the child of his condition, Sayre became convinced that circumcision, at the time an “obscure religious ritual,” was the answer to a number of medical mysteries. Sayre believed that this particular surgery was a remedy to everything from epilepsy, to bladder disease, to lunacy. Although the results of his experiments were inconsistent at best, his evangelism on the subject almost single-handedly transformed views on circumcision in the US, taking it from unconventional to mainstream.

But some of Bellevue’s so-called “advancements” were even more controversial. By the 20th century, the hospital housed a number of patients whose psychiatric conditions were so severe that standard treatments were ineffective. The last resort was usually a lobotomy, the ignoble operation that “cured” a mental patient by tampering with his or her frontal lobe — often leaving the victim of this procedure in a permanent vegetative state. This was not an ideal result, and that’s why doctors were willing to experiment with convulsive therapy, or shock treatment, which originated in Europe but made its first stateside appearance at Bellevue. To this day, it’s not entirely clear why seizure-inducing ECT works for some patients. The legacy of ECT at Bellevue is complex — the hospital only recently started using it again, in 2015, after activists successfully campaigned against it in the 1970s. It’s a rare instance when hospital staff halted their research on account of public pressure.

For better and for worse, Bellevue has left a considerable impression on the history of US medicine. “In treating the weak they strengthened themselves,” Oshinsky says of the doctors there. It’s a testament to the power of public service: Despite missteps, there’s potential for greatness in the challenge of doing good.