Sen. John McCain (R-Ariz.) is appearing in campaign ads just weeks after his death in late August. (Susan Walsh/AP)

A Democratic candidate in New Jersey is invoking Sen. John McCain in a campaign ad, a little over two weeks after the Arizona Republican’s death from brain cancer Aug. 25.

Tom Malinowski, a former Obama assistant secretary of state who is running to unseat Rep. Leonard Lance (R) in New Jersey’s 7th Congressional District, unveiled the ad Wednesday. The TV spot opens with footage of McCain praising Malinowski during his Senate confirmation hearing in 2013.

“This is a contribution Tom made, most of all, in the fight here in Congress to end torture, and I am forever grateful to him for that,” McCain is heard saying in the ad.

McCain, who was tortured during his more than five years as a prisoner of war in Vietnam, wrote a measure in 2005 prohibiting the torture of U.S. detainees. At the time, Malinowski was a vocal anti-torture advocate in his role as Washington advocacy director for Human Rights Watch.

Benji Schwartz, a spokesman for Malinowski, said the candidate has been in touch with McCain’s representatives throughout the campaign and that they expressed no objections to him using the footage or speaking about his work with McCain. Schwartz added that Malinowski’s campaign had begun using the footage in February.

The Congressional Leadership Fund, a super PAC that backs House candidates and is aligned with House Speaker Paul D. Ryan (R-Wis.), last month seized on Malinowski’s work with Human Rights Watch to claim in a TV ad that he “lobbied for terrorists’ rights.” Two former top McCain aides spoke out in defense of Malinowski at the time.

The race has seen both candidates highlight their bipartisan bona fides. Last month, Lance touted his endorsement by Giffords, the national gun-control group founded by former congresswoman Gabby Giffords (D-Ariz.).

The suburban New Jersey district includes the township of Bedminster, where Trump National Golf Club, a frequent weekend retreat for President Trump, is located.

McCain is also featured in a TV ad released Wednesday by the National Republican Congressional Committee against former congresswoman Ann Kirkpatrick (D-Ariz.), who is seeking to return to Congress.

The ad includes footage of McCain attacking Kirkpatrick’s record on taxes, federal spending and debt reduction during their Senate battle in 2016.

The NRCC also aired an ad Wednesday in Michigan featuring McCain’s past criticism of Democratic House candidate Elissa Slotkin.

Rick Davis, a longtime McCain adviser and spokesman for the senator’s family, told Politico that the family was displeased with the NRCC’s use of McCain in its ads.

“The family is disappointed that John’s image is being weaponized this election cycle so soon after his passing, and they had hoped there would be a more appropriate amount of time for people to think about his final message before they began to politicize him,” Davis said, according to Politico.