Google on Wednesday announced new restrictions on political advertisers around the world, among them rules that bar candidates, including President Trump, from targeting narrow categories of Web users based on their political affiliation.

The updates come as Google and its tech industry peers continue to face sharp criticism for allowing politicians to lie in ads — a practice that Google did not entirely outlaw as it pledged that “trust in electoral processes” outweighed the “cost or impact to spending” on political ads.

Under the new rules, political advertisers in the United States and abroad now may target their ads in search and on Google-owned YouTube only down to the postal code level. These campaigns may also target people on the basis of gender or age, but they cannot do so based on voters’ political affiliations or public voter records, Google said, breaking with past policies.

Google also said it would bar “making demonstrably false claims that could significantly undermine participation or trust in an electoral or democratic process,” including those that seek to mislead people about voting.

But the company’s policy did not appear to prevent the sort of ad recently purchased by Trump’s 2020 campaign, attacking former vice president Joe Biden, a Democratic contender for the White House, with falsehoods about his ties to Ukraine. The ads had been viewed millions of times on Google, according to the company’s ad archive.

“Of course, we recognize that robust political dialogue is an important part of democracy, and no one can sensibly adjudicate every political claim, counterclaim, and insinuation,” wrote Scott Spencer, the company’s vice president for product management on ads. “So we expect that the number of political ads on which we take action will be very limited — but we will continue to do so for clear violations.”

Google’s announcements Wednesday reflect Silicon Valley’s continued struggle to find the right balance around paid political speech. Four years after Russian agents spread disinformation on major social media sites, regulators and voters are more acutely aware about the ease with which popular online services can be weaponized to deceive them to the detriment of democracy.

Twitter this month set in motion a plan to ban advertising from political candidates and their well-funded allies. Facebook similarly has said it is open to changes, after staunchly defending its decision to allow the Trump campaign’s ad about Biden to remain online despite the former vice president’s request that it be removed.

But the tech industry’s fixes have sparked mixed reactions from Democrats, who have pined for Silicon Valley to more tightly regulate ads, and from the Trump campaign, which has sharply criticized the reforms. Top aides to the president’s reelection effort assailed Facebook on Wednesday for even considering reforms to its rules that would limit political targeting.

Google’s suite of announcements Wednesday address some of the criticism it has faced in recent months. The company, for example, long had applied its political-ad-transparency rules only to federal candidates. Now it is preparing to expand the policies to include a wider array of actors, including political parties and state candidates. Google said it is considering “additional transparency” measures over the coming months.

Still, the changes don’t address the full litany of issues raised by lawmakers, digital experts and campaign-finance-reform advocates. Many have called on Google to be more transparent with users and disclose more data about a wider variety of the ads they see, including those that touch on hot-button political issues such as abortion or immigration

Google’s new political ad policies do not prevent political candidates and others from advertising in a contextual way — such as displaying ads about their views on the economy around a YouTube video that touches on economic issues.