Updated

President Obama says Republican Sen. Pat Toomey of Pennsylvania needs to do more to show courage than taking one right vote on legislation to expand background checks on firearms purchases.

Obama responded Saturday to Toomey's campaign airing a TV ad that shows Obama speaking outside the White House in 2013 and thanking Toomey for his courage, despite the bill's failure. The ad is running in Philadelphia and Pittsburgh.

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

Toomey is working to win over moderate voters in his too-close-to-call race against Democrat Katie McGinty in Democratic-leaning Pennsylvania.