WASHINGTON — Senator Heidi Heitkamp, the centrist Democrat from North Dakota who is fighting a pitched battle to save her seat, has gotten a lift from an unlikely source: the conservative billionaire Koch brothers.

Americans for Prosperity, the political advocacy group backed by Charles G. and David H. Koch, unveiled a digital ad campaign on Friday thanking Ms. Heitkamp for her support of recently passed legislation that loosened regulations on small and medium-size banks that were swept up in the 2010 Dodd-Frank law passed in the wake of the 2008 financial crisis.

[David Koch Died on Aug. 23 at the Age of 79]

The ad is the latest evidence that the brothers, often at odds with President Trump, may be moving away from strictly partisan work on behalf of Republicans in favor of initiatives that will advance their libertarian-leaning legislative priorities, including free trade, immigration legislation and access to medicines, regardless of party affiliation.

Ms. Heitkamp is one of 10 Democratic senators up for re-election in states won by Mr. Trump in 2016, but unlike other Democrats, she has drawn a top-flight challenger in Kevin Cramer, North Dakota’s lone House member and a close ally of the president’s. Her seat is one of the keys to Republican efforts to hold on to or expand the party’s one-seat Senate majority.