After months of praising the response of the World Health Organization to the coronavirus pandemic as “working hard and very smart,” President Trump has pivoted to accuse the U.N. health agency of being too slow to react to the virus, giving faulty advice about travel bans and — above all — showing favoritism toward China. Republicans and even a few Democrats have echoed elements of that criticism. The administration is reportedly considering withholding U.S. funding from the WHO even as the U.N. agency plays a vital role in the international response to the pandemic.

This would be an enormous mistake. WHO is far from a perfect institution, but it is hardly responsible for the slow U.S. response to this crisis.

The latest attempt at blame-shifting overlooks the fact that the alarms on this coronavirus were ringing loudly enough for many other nations to move decisively and for many U.S. government experts to be concerned. It is not the WHO’s fault that such warnings were ignored at the White House and at some U.S. statehouses.

On Jan. 9, the WHO reported that the mysterious pneumonia illness in China was a novel coronavirus, the same type of pathogen that had caused the SARS epidemic in 29 countries in 2002 and 2003. The next day, the WHO issued a comprehensive package of technical guidance with advice to all countries for how to detect, test and manage potential cases. On Jan. 23, the organization held an international news conference, confirming a basic picture of the virus that holds up reasonably well today: a novel coronavirus spreading person to person, more transmissible than the seasonal flu and 40 times deadlier, with an estimated fatality rate of 4 percent. A week later, the WHO declared a public health emergency of international concern, the highest level of alarm that the organization is authorized by its member states to issue.

The United States and South Korea confirmed their first cases of covid-19 within a day of each other, less than two weeks after the first WHO alert. South Korea marshaled a robust public health response that tested three times as many citizens per capita as the United States, and three months later, it has kept reported cases to about 10,000. U.S. cases now exceed 500,000, and the U.S. mortality rate of covid-19 is three times as high as that of South Korea. Japan, Singapore and Taiwan also looked at the same set of facts as the rest of the world and triggered immediate action while the United States did not.

The WHO is not to blame for the United States failing to impose a travel ban earlier. Forty-five nations imposed travel restrictions on China before the United States did, including Australia, Iran and Italy. The earliest of these restrictions took effect on Jan. 24, nine days before the U.S. travel ban on Feb. 2 that Trump now boasts about implementing. The WHO did advise against travel bans and, as the U.S. experience demonstrates, these bans have not proved effective in stopping the spread of the coronavirus. The WHO had previously warned that travel bans contribute to “a false impression of control” — the misperception that a ban would be sufficient to stop the spread of disease. The U.S. reliance on travel bans over domestic readiness suggests that the WHO had a point.

Trump’s criticism that the WHO is beholden to China and its resources is also misplaced. The deference that the organization has shown in this pandemic is not unique to China, this virus or even current WHO leadership. The organization prizes solidarity in responding to emergencies. Contrary to the president’s claims, it has refrained from shaming any nation by name for not following its guidance — on travel bans or anything else. The WHO also was criticized in the past two Ebola outbreaks for being slow to declare a public health emergency of international concern over the wishes of Congo and the affected West African nations, which are not significant contributors to the WHO budget.

The tendency of WHO to defer to its member governments in a crisis should absolutely be reviewed after the current pandemic ends. Yet it also should be recognized that deference flows from constraints that WHO member governments, including the United States, have chosen to impose upon it. The U.N. agency has an expansive global mandate, but an annual budget of $2.2 billion, smaller than many major U.S. hospitals. It cannot operate in member countries without their permission, and it has no power to sanction them for not following its rules. Accordingly, the WHO depends on cooperation from governments to compensate for its limited resources and authority.

The organization has not always responded to crises well, but it has shown a capacity to rectify shortcomings when its member states are unified. It was widely and rightly criticized for its abysmal failings in the early phases of the 2014 Ebola outbreak — failings that followed a period in which the WHO had been chronically underfunded and its member states had prioritized non-emergency programs. Once that crisis ended, member states did not defund or abandon the organization; they rightly concluded that its emergency functions needed to be reformed and strengthened, not undermined. This led to a major organizational overhaul and the creation of a new Health Emergencies Program.

These reforms have shown progress in the current pandemic. The organization has moved quickly and effectively, particularly in light of the institutional constraints and anemic funding it faces from member states. The WHO is advising health ministries through its country offices and supplying working test kits, masks and personal protective equipment to low-income countries that request them. When needed, the WHO has deployed doctors and scientists as boots on the ground to assess, advise and implement control strategies in countries with weak health systems.

For the past 2½ months, the director general and his advisers have answered hours of questions in regular live-streamed briefings, providing credible and accurate information about this virus and urging countries take the steps to defeat it. When Director General Tedros Adhanom Ghebreyesus was warning in late February that this coronavirus “absolutely” had pandemic potential, Trump was still saying that U.S. reported cases would soon go from 15 “down to close to zero.”

The problem is not that, as the president now says, the WHO “called it wrong.” Rather, the organization called it pretty well. He simply didn’t listen.

The WHO we have today is the WHO that the world has chosen to build. It plays an irreplaceable role in global outbreak response and, in the current crisis, it has largely served its purpose well. The organization rang the alarm early and provided credible information at a time when better preparedness could still have made a difference. U.S. policy should seek to strengthen and enhance the WHO’s independence and effectiveness, not degrade it amid a crisis.