Facebook removed Trump campaign ads on Thursday for violating its policy against misleading references to the U.S. census amid criticism that it has given politicians too much leeway to misinform users on its platform.

The Trump ads urged Facebook users to “take the official 2020 Congressional District Census today,” but despite the look and language of the ad, they were not related to the once-a-decade national count of U.S. citizens happening this year. Instead, the ads linked to a survey on the “Certified Website of President Donald J. Trump,” which collected information and requested a donation.

Facebook initially said it would permit the ads, ruling that they were clearly not a part of the U.S. census, according to Popular Information, a politically themed online newsletter that first reported on the ads and the company’s refusal to remove them. Facebook announced its policy against misleading references to the census in December.

House Speaker Nancy Pelosi (D-Calif.) sharply criticized Facebook’s decision in a news conference Thursday. “I am particularly annoyed today at the actions of Facebook. Facebook has something that is an official document of Donald Trump as saying, ‘Fill this out, this is a census form’ — it is not. It is an absolute lie, a lie that is consistent with the misrepresentation policy of Facebook. But now they are messing with who we are as Americans,” she said, according to a transcript on her website.

Facebook reversed its position hours later, saying that the ads indeed violated its policy against “misrepresentation of the dates, locations, times and methods for census participation.”

Spokesman Andy Stone said, “There are policies in place to prevent confusion around the official U.S. census, and this is an example of those being enforced.”

Asked about Facebook’s turnaround in its ruling about the Trump census ads, Stone said, “We conducted a further review.”

Trump campaign spokesman Tim Murtaugh declined to comment about the ads or Facebook’s decision. The ads were paid for by the Trump Make America Great Again Committee, which raises money for the Trump campaign and the Republican National Committee in support of the president’s reelection.

Facebook’s handling of the ads frustrated civil rights leaders and Democrats who have warned that the company’s rules against misinformation are too lax.

“Facebook has demonstrated once again that protecting its users from misinformation is not a priority, and instead that its integrity can be bought by the Trump campaign,” said Rashad Robinson, president of civil rights group Color of Change, in a statement. “While Facebook has now committed to removing the mis-informing post in question, the damage is done.”

The Trump campaign ads echoed similar surveys the RNC has mailed out that look like census forms but are in fact requests for donations.

Congress has passed laws, including one after the 2010 Census, aiming to curb mail that impersonates a federal agency. At an Oversight Committee hearing last month, House Democrats pressed Census Bureau Director Steven Dillingham on the matter, asking him to request that the RNC stop sending out fundraising mailers that mimic census forms.

Dillingham said he was not sure who had sent out the mailers. After Rep. Katie Porter (D-Calif.) pointed to small print on one of the forms indicating it was from the RNC, Dillingham said, “We will study this problem.”

Facebook has struggled with how to draw the line against misinformation that comes from political figures such as President Trump. During the U.S. midterm elections, the social network initially allowed — and then removed — an ad featuring comments by Trump about asylum seekers from Mexico. The comments were widely denounced as racist.

In January, Facebook blocked Trump ads that asked users to offer their opinions of the U.S. military. Users could share their opinion by pressing a “yes” or “no” button. Such so-called “fake buttons” are disallowed by Facebook because the company sees them as a spammy tactic.

The company announced in September that it was exempting claims by politicians from its fact-checking program, one of the company’s key reforms after the 2016 election, when false claims ran rampant on the platform.

That decision sparked outrage from Democrats, who feared Trump’s well-chronicled use of exaggerations and falsehoods to further his political goals. It also enraged civil rights activists, who warned that falsehoods often are used to suppress voter turnout and undermine census counts that are critical to allocating federal financial resources.

Facebook adopted its policy against misleading census claims after consulting with civil rights groups, including the Leadership Conference on Civil and Human Rights. Its president, Vanita Gupta, sharply criticized Facebook’s initial decision to allow the Trump ads and praised its later reversal.

“While we’re gratified that Facebook shut down Trump’s attempt to sow confusion about how and when to participate in the 2020 Census, it’s disturbing that the ads weren’t immediately removed,” Gupta said in a statement Thursday afternoon.

Elizabeth Dwoskin in San Francisco and Michelle Ye Hee Lee in Washington contributed to this report.