Before Hurricane Maria, Puerto Rico’s worst natural disaster in nearly a century, the island was already grappling with insolvency. The government declared a form of bankruptcy last May, after years of borrowing money to pay for operating expenses after a painful recession that began in 2006.

The relief package sets aside $4.8 billion for Medicaid in Puerto Rico and the Virgin Islands, helping to avoid a looming shortfall that could have left some 600,000 Medicaid beneficiaries in Puerto Rico without health insurance by April.

Puerto Rican leaders worried some of the people left uninsured would migrate to the mainland seeking coverage. Compared to the states, territories receive only a fraction of funding for entitlement programs. The Senate deal would waive the requirement for Puerto Rico and the Virgin Islands to share in the cost of Medicaid for two years, placing the funding responsibility on the federal government instead.

Louisiana received the same reprieve after Hurricane Katrina, but for only one year, said Representative Jenniffer González-Colón, Puerto Rico’s nonvoting delegate in Congress. Lawmakers approved relief packages for 10 years after that storm, she noted. Puerto Rico is not that far removed yet from Hurricane Maria.

“Receiving these funds is important, and that will demonstrate that Puerto Rico will use them wisely and with transparency,” she said. “That’s an important issue here: We can be a model for how to invest in infrastructure on the island.”

Puerto Rico’s governor, Ricardo A. Rosselló, said the $2 billion earmarked for power restoration in Puerto Rico and the Virgin Islands could help his island harden its battered grid. While funds from the previous aid packages went to FEMA and the Army Corps of Engineers, the latest relief package will give money directly to the Puerto Rican government.