RIO DE JANEIRO — When the Olympics kick off Friday, ailing athletes will go to a sparkling new clinic built just for the games. Sick tourists, meanwhile, will be sent to a public hospital whose cramped communal quarters may come as a surprise.

Municipal Hospital Souza Aguiar, housed in a gloomy 1960s building in downtown Rio de Janeiro, is one of five public hospitals officially designated to accept Olympic tourists. Spectators who attend the opening and closing ceremonies — as well as other sports in the Maracanã Olympic Zone, including soccer, track and field, and archery — will be directed to Souza Aguiar.

A recent tour revealed some of the challenges the city and 361-bed hospital face as Rio tries to put on its best face for the games. Souza Aguiar has set aside 40 new beds in three renovated rooms to treat multiple victims in case of a major accident or terrorist attack. But remodeling hasn’t changed the reality at Rio’s largest hospital, in which patients worry about their security and spend nights sleeping just a few feet away from each other in cold wards. The hospital has no private rooms.

In one communal area in a trauma wing, two patients lay in beds across the room from a dead body. The patient had just had a heart attack on a bus. His body lay in a gray bag, zipped up to his armpits, visible to anyone in the room. As visitors walked through, one of the doctors leading the tour drew closed a curtain around him.

Tourists are arriving during Brazil’s worst economic crisis in decades. The state of Rio de Janeiro in December declared a public health emergency, with hospitals closing units and running out of money for salaries, equipment, and basic supplies such as diapers and needles. But Souza Aguiar is run by the city, which is in better financial shape than the state. City officials say Souza Aguiar employees do get paid on time.

In the face of allegations from local doctors that city hospitals are too overcrowded to handle Olympic visitors and lack basic supplies, officials at Souza Aguiar insist they’re ready.

The front entrance of Municipal Hospital Souza Aguiar.

Dr. Letícia Louzada (left), chief of emergency medicine, and Dr. Lucia Orfão, hospital vice-director, in the lobby of the nonsurgical emergency room.

Outside the hospital just after sunset one recent day, a row of homeless people lay wrapped in blankets, huddled against the fence that separates the hospital from the street. A car slowed and a woman started handing out aluminum plates of food, which were quickly snatched up.

Tourists arriving to the hospital will likely pass the front entrance, turning into the ambulance bay that leads to the emergency room.

That’s the same spot where, on June 19, armed attackers freed a suspected drug kingpin named Fat Family, who had been in police custody there. In a blaze of 28 bullets, one patient died, and a nurse technician was severely wounded when he was struck by a bullet in the abdomen while talking on his phone.

During the recent tour, one patient, 52-year-old Vivaldo Souza da Silva, told STAT he was lying in a hospital bed that June day, recovering from a toe amputation, when he heard a flurry of gunshots. He said he became worried when he found out the attack occurred at the hospital.

Hospital officials emphasized that the shootout was outside the hospital doors, in an area that should be monitored by police.

“Police knew about the rescue. They should have closed the perimeter,” said Dr. Lucia Orfão, vice-director of the hospital, who led STAT around the hospital.

She said Fat Family, who was waiting for facial surgery from a gunshot wound, couldn’t be transferred to another hospital. In the future, she said, the hospital aims to speed up medical care for patients in police custody to reduce the risk of another conflict or escape. Mental health counselors are working with staff who are reeling from the attack, Orfão added.

The hospital has experience with mass casualties, treating patients from a fatal tram derailment in 2011 and a dramatic fence collapse that injured dozens at a nearby soccer stadium in 2000, Orfão pointed out. To prepare for the Olympics, the hospital has trained staff to respond to tragedies with multiple victims, she said.

With up to half a million visitors set to descend on the city for the games, keeping them healthy could be a big job. Officials are preparing to treat an estimated 20,000 people during the games. But Brazil’s health minister predicted most will be treated at pop-up clinics at the Olympic venues, and only about 700 will need to visit a hospital.

Orfão rattled off a few likely causes that will bring them in her doors: drinking too much, drug overdoses, broken limbs, or trauma from fighting or falling. The Zika virus, which has prompted international alarm and spurred some athletes, spectators, and commentators to skip the games entirely, wasn’t even on her list. (Because it’s winter, the number of cases is expected to be very low — way less likely than getting the flu.)

Telio Diniz, 65, is wheeled through the lobby of the emergency room.

Souza Aguilar is one of five hospitals designated by the city of Rio de Janeiro to treat tourists during the 2016 Olympic Games.

Patients Osvaldo Portela (left), 71, and Vivaldo Souza da Silva, 52, both hospitalized for infections of their amputated toes, slept next to each other in a shared cubicle.

Besides having extra translators on hand to guide them, tourists entering the hospital won’t be treated differently than the everyday Brazilians seeking care there, Orfão said — patients like da Silva.

A painter who lives an hour away from Rio, da Silva sat on a narrow cot taking bites of plain white bread. He shared a small bay with a man who shared the same affliction: after having their toes amputated due to diabetes, the wounds had started bleeding again.

The two men slept just a few feet from each other in a wing designed for patients with medium-severity medical conditions. Patients are separated by gender into two communal rooms. There are supposed to be 18 beds, one patient per bay, but the wing routinely has 40 patients instead, Orfão said.

The man da Silva slept right next to, 71-year-old Osvaldo Portela, didn’t complain. He called the medical care “wonderful” and said he slept very well.

Pronto Bar, a vintage 1960s diner, is on the hospital’s ground floor.

But a report issued July 18 from a local medical council, CREMERJ, cast the hospital in a different light. CREMERJ, which licenses and oversees doctors in the state of Rio de Janeiro, claimed all five hospitals designated to receive Olympic tourists are too crowded to handle the foreign visitors. Souza Aguiar and its adjacent regional emergency center don’t have the resources to handle their typical number of patients, who are sometimes put in improvised furniture such as chairs and ambulance stretchers, the report charged. The report also said there’s a shortage of medicine, and of equipment for monitoring critically ill patients.

City officials dismissed the report as a politically motivated attempt to disparage the public health system, but declined to specify the motivation. A city spokesman said the hospital has been planning for the Olympics for four years and has all of the resources it needs to treat patients. City officials noted that Rio hospitals have already handled other events with huge crowds, including Carnival, New Year’s Eve, and the World Youth Day.

Orfão conceded her hospital is “a little bit crowded, because the demand is high.” But “we don’t have patients in the hallway,” she said.

All the patients appeared in beds, not chairs, during STAT’s tour, which took place on a Friday afternoon, not late at night, which tends to be busier. One patient was lying on a gurney in the middle of the emergency department waiting room — but he said he was on his way out the door and had waited only 15 minutes for treatment of a blocked catheter.

“I have nothing to say against the hospital!” the patient, 65-year-old Telio Diniz, declared.

Wait times aren’t as short for less urgent maladies. In another part of the hospital, Jorge Antonio dos Santos lay in a chilly shared room, wrapped in a fuzzy purple blanket, awaiting surgery. The 45-year-old handyman had swallowed a bone, which was stuck in his digestive tract. He got to the hospital at 8 p.m., but had to wait as surgeons tended to more severe cases — a shooting victim and an Australian tourist who fell. So he slept in the so-called “green room,” which has 16 beds for low-severity cases. About 20 hours later, he was still waiting, with his wife by his side.

Souza Aguiar will have extra doctors on staff, including eight more surgeons, to handle the Olympic crowds, Orfão said. The hospital will also have some donated medical equipment from GE Healthcare on hand, but nothing compared to the Olympic Polyclinic, where athletes will be welcomed to a new 38,000-square foot space equipped with X-ray rooms, MRI scanners, and eight cryotherapy pools for athletes to dunk into cold water after they compete.

Visitors who end up at Souza Aguiar, however, may rest their feet in a spot that the Olympic money can’t recreate: a vintage 1960s diner called Pronto Bar, offering thin-sliced Brazilian beef sandwiches and fresh mango juice.

Rio-based journalist Thalita Pires contributed reporting.