EVEN AS MASSACHUSETTS hospitals were coping with an influx of COVID-19 patients this spring, they were losing massive amounts of money. While some hospitals got large sums of federal relief money, a new report from the Center for Health Information and Analysis shows the aid was nowhere near enough to offset the losses.

While community hospitals were hardest hit, all types of health and hospital systems suffered.

For example, Mass General Brigham (formerly Partners HealthCare), the state’s largest health system encompassing nine hospitals, lost a staggering $968 million in March. The system would receive $318 million in coronavirus relief funds during April and May — enough to provide a profit of nearly $250 million over the course of those two months but not enough to offset March’s losses.

Overall, the report by CHIA, an independent state agency tasked with analyzing health care data, found that in March, 34 of 36 individual hospitals lost money. Among all hospitals that sent in data, the median hospital reported a financial loss of 28.9 percent, when revenues are compared to expenses. Even with the influx of federal relief money in April and May, the median losses were 14.9 percent in April and 3.3 percent in May.

The losses were due to declining revenue, which was not matched by reduced expenses. The losses came as hospitals were forced to cancel all elective procedures and doctors essentially shut their doors to non-emergency care. Even for urgent problems, doctors reported that patients hesitated to come in out of fear of COVID-19.

Different types of hospitals were affected in different ways. Academic medical centers were the only type of hospital to earn more money in any one of those months than in a comparable period in 2019. They turned a slight profit in May due to the distribution of federal relief funds. Community hospitals were hardest hit, with declines in operating revenue of 23.2 percent in March, 40.3 percent in April, and 37.8 percent in May.

Coronavirus relief funds — $642 million in federal dollars and $84 million from the state – did help the hospitals significantly, although in most cases it was not enough for them to break even.

The state’s second-largest hospital system after Mass General Brigham, Beth Israel Lahey Health, lost $160 million in March, $52 million in April, and $31 million in May, even after accounting for $157 million in coronavirus relief funds.

The report is a snapshot rather than the full picture of the financial position of Massachusetts hospitals, since the hospital systems reported the information voluntarily to CHIA, and not all participated. Of 61 acute care hospitals in the state, 38 sent information into CHIA.

The Massachusetts Health and Hospital Association said in a statement that the report paints a clear picture of the serious economic challenges our hospitals are facing.

“Massachusetts hospitals continue to grapple with the immense losses brought on by COVID-19, which threaten the stability of many healthcare organizations – especially community and safety net providers,” the statement said. “Additional relief will be essential in bringing our system back to full strength, especially as we prepare for a second wave and focus on remaining fully accessible to all patients.”