A campaign ad attacking Republican Sen. Jeff Flake falsely says that he hasn’t worked with President Donald Trump to “repeal Obamacare.”

Flake voted for the three different Senate proposals to repeal parts of the health care legislation that former President Barack Obama signed into law in 2010.

The ad, titled “Arizona Deserves Better,” is from the campaign of Dr. Kelli Ward, a physician and former state senator challenging Flake in Arizona’s GOP Senate primary.

The 47-second spot questions Flake’s conservatism and highlights comments he has made criticizing Trump. It was “distributed digitally across Arizona” prior to Trump’s rally in Phoenix on Aug. 22, according to a Ward campaign press release.

The ad gets several things right about Flake’s criticism of the president.

However, the ad runs into trouble when the narrator suggests that Flake hasn’t been willing to work with the president on his agenda.

“Why aren’t you trying to work with President Trump on reforms that help Arizona?” the narrator asks. Flake, the narrator says, hasn’t worked with Trump “to create more U.S. jobs, to build the wall, and repeal Obamacare.”

The ad is completely wrong to say that Flake, who is up for reelection next year, hasn’t supported Trump’s efforts to repeal the Affordable Care Act, otherwise known as Obamacare.

In a failed effort to repeal the law before leaving for summer recess, the Senate voted on three major bills (the Better Care Reconciliation Act, the Obamacare Repeal Reconciliation Act and the Health Care Freedom Act) from July 25 to July 28 that Senate Republicans had proposed to repeal or replace parts of the health law. Flake, as this New York Times chart illustrates, voted for all three.

There were 13 Republican senators who voted against at least one of the proposals, four who voted “no” on at least two of them, and two who opposed all three versions.

In fact, Flake has voted in line with Trump’s position 93.5 percent of the time, according to FiveThirtyEight’s analysis of congressional votes as of Aug. 2. Among Republicans, 19 of them have voted most often with Trump’s position at 95.8 percent, and Sen. Susan Collins of Maine voted the least often in line with Trump at 79.2 percent.

The analysis shows that Flake’s only major votes against the president’s position have been on sanctions against Russia (which Trump opposed and nearly every member of the Senate supported) and an appropriations bill for fiscal year 2017.

As for the border wall, Flake has said that a wall “in certain places” along the border is appropriate, although it “doesn’t make sense obviously to have a 2,500 mile” wall.

In addition, the Wall Street Journal reported that “not a single member of Congress who represents the territory on the southwest border,” including Flake, supported Trump’s request for $1.4 billion for border wall spending.

And while the ad says that Flake is “not a conservative,” the Times analysis actually put him in the “more conservative” group of the Senate along with Republican Sens. Ben Sasse of Nebraska, Rand Paul of Kentucky, Mike Lee of Utah and Ted Cruz of Texas.

Robert Farley contributed reporting for this article.