WASHINGTON, DC - JANUARY 12: President Barack Obama delivers his State of the Union address before a joint session of Congress on Capitol Hill Jan. 12, 2016 in Washington, D.C. In his final State of the Union, President Obama reflected on the past seven years in office and spoke on topics including climate change, gun control, immigration and income inequality. (Photo Credit: Evan Vucci - Pool/Getty Images)

HARRISBURG, Pa. (AP) – President Barack Obama struck back at Republican U.S. Sen. Pat Toomey on Saturday for using footage of the Democrat praising Toomey’s courage in a TV campaign ad in his life-or-death re-election bid in Pennsylvania.

In a statement to The Associated Press, Obama said Toomey needed to do more to show courage than taking one right vote on legislation to expand background checks on all firearms purchases online and at gun shows.

“Courage is telling Pennsylvania voters where you stand on the tough issues, not just the easy ones like background checks,” Obama said in the statement. “Pat Toomey won’t tell Pennsylvania voters where he stands on Donald Trump, trying instead to have it both ways by telling different people what he thinks they want to hear. That’s not courage. Voting to shut down the government and against bills to close the terrorist gun loophole isn’t courage. And playing politics with the Supreme Court isn’t courage.”

Obama has endorsed Toomey’s opponent, Democrat Katie McGinty, who served in Bill Clinton’s White House and was recruited by national Democrats to run against Toomey.

Toomey, who compiled one of Congress’ most conservative voting records, is among the Senate’s most vulnerable incumbents in a state where Democrats have a 4 to 3 registration advantage over Republicans. The race could help tip control of the Senate to Democrats.

Toomey has been a tough critic of Obama, and opposed practically all of Obama’s major policy initiatives, from health care to immigration. He routinely delivers a stump speech that labels Obama’s economic and foreign policies as complete failures.

At a campaign event on Saturday, he lambasted the handling of economic policy in Washington, without naming Obama. Toomey told reporters after the event in West Chester, 25 miles west of Philadelphia, that he was not worried that his use of Obama in a TV ad would hurt him with Pennsylvania’s Republican voters.

Join The Conversation On The KDKA Facebook Page

Stay Up To Date, Follow KDKA On Twitter

“President Obama stood up publicly and praised my work of reaching across the aisle and trying to get something done on an important issue, which is background checks,” Toomey said. “And of course the other side has tried to discredit and deny the work that I did. I think President Obama said it well, so we used his clip, it’s his quote, him, it’s what he said, in context.”

In the 30-second ad, Obama is speaking outside the White House in 2013 and thanks Toomey for his courage, despite the bill’s failure.

“That was not easy,” Obama said of the work by Toomey and Sen. Joe Manchin, D-W.Va.

It is the latest, and perhaps the most eye-opening, way in which Toomey is working to appeal to moderate voters whose support he will need to beat McGinty. The ad is running on cable in the Philadelphia and Pittsburgh markets.

The vote on the background checks bill cost Toomey endorsements from gun rights groups, including the National Rifle Association, even though Toomey voted more often than not with the NRA. But that vote by Toomey also helped him pick up the endorsements of two prominent gun-control activists, billionaire Michael Bloomberg and former Democratic congresswoman Gabrielle Giffords.

(Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.)