WASHINGTON — President Donald Trump on Tuesday signed into law a four-month extension of the National Flood Insurance Program, providing relief to nearly two million Floridians through the end of hurricane season.

The program was due to expire at midnight, but the Senate on Tuesday followed the House in approving the extension, the seventh such short-term reauthorization amid ongoing criticism over cost.

"While this four-month extension was crucial, we cannot keep kicking the can down the road and delaying much needed reforms," said Republican Sen. Marco Rubio, vowing to address "the fundamental flaws of the program, which will allow the NFIP to move forward on a path to affordability and sustainability."

If lawmakers failed to act Tuesday, people could not obtain new flood insurance policies or renew those that expired.

The National Flood Insurance Program covers 5 million homeowners and business owners nationally, including nearly 1.8 million in Florida. Rocked by a series of big storms, it is more than $20 billion in debt to the federal treasury, despite a $16 billion bailout from Congress last year.

That has triggered criticism from fiscal conservatives who say it's not only costly but encourages development in flood prone areas.

"The NFIP does not accurately measure or charge for flood risk, which means that tens of thousands of its policyholders are lulled into a false sense of security when they are really in harm's way," U.S. Rep. Jeb Hensarling, R-Texas, told colleagues recently. "The program also creates perverse incentives to build and rebuild homes in flood-prone areas."

SmarterSafer, a coalition of environmental groups, taxpayer watchdogs and insurance stakeholders, said the extension is better than nothing but urged Congress to act on reforms, including encouraging private insurers into a market almost exclusively covered by the federal government.

"The critical overhaul of the nation's broken flood insurance program must prioritize reforms that promote mitigation against the threat of flooding, update and improve antiquated flood-risk maps and ensure full communication of flood-risk data to communities and home-buyers," the group said.

"Congress must also empower consumer choice in the marketplace by clarifying that private flood insurance is an alternative to the one-size-fits-all NFIP. These reforms will re-establish solid financial footing for the NFIP and contribute to a smarter, safer and more robust system of flood insurance to protect the people and property in the path of severe weather events."

The House and Senate have considered long-term fixes but disagreements have stymied action. Sen. Rubio and Sen. Bill Nelson, also of Florida, had pitched a bill that would extend the program by six years and cap annual premium increases at 10 percent, down from the currently allowed 25 percent maximum increase, which authors say depresses property values and discourages participation in the program. Others say premiums need to rise to ease the burden on taxpayers.

Congress passed reforms in 2012 but that led to outcry from property owners suddenly facing huge increases and the housing market was frozen, leading to a reversal.