Days after President Trump ordered a drone strike that killed a top Iranian general, the commander in chief’s 2020 campaign turned the attack into a political pitch, purchasing roughly 1,000 ads on Facebook that touted his military credentials — and sought to raise money for his reelection push.

The online advertising blitz began late Monday as Trump’s team sought to defend the killing of Qasem Soleimani, a major general in Iran’s Revolutionary Guard Corps. Many of the ads solicited personal information from voters that could be useful as the campaign seeks to mobilize voters on Election Day.

The digital strategy mirrors Trump’s previous social media campaigns concerning impeachment, immigration and other signature issues, relying on a mix of narrowly targeted messages — along with headline-grabbing tweets seen by millions — to command the political conversation, mobilize his base and advance his policy agenda with an eye to the election. Trump’s campaign also alerted supporters with similar text messages highlighting Soleimani’s death.

“From a campaign perspective, anytime the president accomplishes something — and fighting terrorism is among his biggest campaign promises, keeping our country safe — that is grounds for making the argument that he should be reelected,” said Matt Braynard, the data director for Trump’s 2016 campaign, who says he is not involved in his reelection effort.

But some experts bristled at Trump’s tactics in the context of national security, stressing that the stakes are higher than usual: Every ad, tweet and social media statement from Trump carries significant weight in a rapidly developing conflict, they said.

“Growing campaign email lists based on fear and online fundraising for political gain should hardly be a priority of the commander in chief during a national security crisis,” said Graham Brookie, the leader of the Atlantic Council’s Digital Forensic Research Lab, which studies disinformation. Brookie previously served in the Obama administration.

Tim Murtaugh, a spokesman for Trump’s 2020 campaign, defended the ads in a statement. “Americans want to see their president acting decisively and defending the nation’s interests and that’s exactly what President Trump did,” he said.

Democrats and Republicans long have sparred over efforts to advertise their military accomplishments in the course of a major election. In 2012, GOP lawmakers and candidates criticized President Barack Obama for running television spots touting his order to kill Osama bin Laden, which critics said were unseemly.

But Facebook, Twitter and other social media sites have become even more pervasive and powerful in the years since Obama left office, an evolution heralded by the digital strategy that helped catapult Trump to the White House in 2016.

Tweets helped Trump push his political views to millions instantly, and Facebook ads allowed the president’s team to target narrow slices of voters with specific messages that would most outrage, engage or persuade them. Both have been put to great use again by the president’s campaign in the days after he ordered the attack on Soleimani, dismaying Democrats, some of whom long have called on tech giants to place limits on Trump, the most prolific but controversial social media user in U.S. politics.

Beginning this week, Trump’s team has run scores of Facebook ads highlighting Soleimani’s death, many pitching an “Official Trump Military Survey” that asks supporters a series of questions, including whether they agree with the president’s “decision to take out the very dangerous Iranian terrorist leader.”

Those who fill it out are asked to submit their personal information, including their emails and phone numbers — a standard practice for candidates like Trump, whose campaign has spent $27 million on Facebook ads since May 2018 in part to build lists of supporters, the company’s archive shows. After clicking a button to submit responses, participants also are asked for donations ranging up to the $2,800 per-election maximum.

Trump’s campaign and his Republican allies also have sent a series of texts in recent days highlighting the Soleimani killing. “Pres Trump made our Military STRONG again!” began one message from the Republican National Committee, according to Nomorobo, an app that helps smartphone users block robocalls and texts. The texts link to the Trump campaign’s data collection survey.

Another batch of texts — sent Wednesday after Trump spoke about Iran — included a “presidential address approval poll,” which asks viewers to rate if he was “historic,” “great,” “good” or “other.”

“A huge piece of Trump’s message and platform from day one is about presenting himself as a strong, machismo leader to his base,” said Tara McGowan, who leads the progressive-leaning digital group ACRONYM, which estimated Trump has run 1,000 ads so far.

“It is clear from the amount of messaging and resources the Trump campaign is putting behind this messaging that he sees this as an advantage for his campaign for reelection,” she said, decrying what she called the president’s “politicizing this military event.”

To be sure, Trump’s Facebook ads do not appear to violate its policies. Dozens of Trump’s ads have been removed from Facebook, according to the company’s public archive, but only because they broke the company’s technical rules for how ads with buttons should be formatted.

At least one of Trump’s 2020 Democratic rivals, former vice president Joe Biden, has run ads of his own this week touting his experience on the world stage and questioning Trump’s fitness as commander in chief.

Other 2020 Democratic contenders have increased their criticisms of Trump on the campaign trail. Speaking to reporters following a town hall in Iowa on Sunday, Sen. Elizabeth Warren (Mass.) questioned the timing of the strike, noting that it unfolded “as Donald Trump faces a potential impeachment trial in the United States Senate next week.”

Andrew Yang, the entrepreneur and former tech executive who has made prolific use of the Internet to power his outsider bid for the Democratic nomination, said matters of war were a bridge too far for quick advertising tactics.

“You hope that our government is making decisions based upon national security concerns and what’s best for the country,” Yang said in an interview, “and not using that as an opportunity to gather voter data.”

Michael Scherer contributed to this report.