HARRISBURG, Pa. -- Republican U.S. Sen. Pat Toomey is turning to the target of some of his toughest criticism to help him in his life-or-death re-election bid in Democratic-leaning Pennsylvania: President Barack Obama.

A new Toomey campaign TV ad running Friday shows Mr. Obama praising Toomey for working with Democrats on legislation to expand background checks on firearms purchases.

It shows Mr. Obama speaking outside the White House in 2013 and thanking Toomey for his courage, despite the bill’s failure. The ad is running on cable in Philadelphia and Pittsburgh.

Get Breaking News Delivered to Your Inbox

You can watch the ad here:

It’s perhaps the most eye-opening way in which Toomey is working to win over moderate voters in his neck-and-neck race against Democrat Katie McGinty.

A Democratic Senatorial Campaign Committee spokeswoman calls the ad disingenuous and says Toomey is trying to make voters think he didn’t help obstruct the Obama administration.

President Obama also pushed back against Republican Sen. Pat Toomey’s use of his wods in a campaign ad for his Senate race.

In a statement to The Associated Press, Mr. Obama says courage is telling voters “where you stand on the tough issues.” Mr. Obama also criticized Toomey for refusing to say whether he’ll vote for Republican presidential nominee Donald Trump.

President Obama, in his 2012 general election contest against then-Republican nominee Mitt Romney, won by about five percent of the vote in Pennsylvania.

The Real Clear Politics average of the most recent polls in the state puts McGinty in the lead over Toomey by two points.