HELENA, Mont. (AP) — U.S. Sen. Jon Tester went on the attack Saturday against Republican candidate Matt Rosendale as the Montana Democrat fights to keep his seat in a tightening Senate race.

Tester is one of 10 Senate Democrats seeking re-election in states won by President Donald Trump in 2016.

He got personal during Saturday's debate in Bozeman by contrasting his own Montana roots with Rosendale: "Somebody who was born in Maryland, made millions of dollars developing property, bought a ranch in Montana, claims to be a rancher but has no cows," Tester said.

Rosendale, the state auditor and insurance commissioner whose campaign has gotten a boost from repeated visits from Trump, responded by accusing the incumbent of selling out Montana for the interests of Senate Democratic leaders.

"This is what happens when you spend too much time in the federal government," Rosendale said. "He's been there for 12 years, and he thinks that he can determine what is best for you and what is best for your family. And I don't think so."

Rosendale, 58, has closely aligned his campaign with Trump, who won Montana in 2016 by a wide margin. Besides pledging allegiance to the president's agenda, Rosendale also has hammered Tester for voting against Trump Supreme Court nominees Brett Kavanaugh and Neil Gorsuch.

Tester, 62, has walked a line in trying to rally the Democratic base without alienating the Trump supporters he'll need to win re-election. He has run ads demonstrating that he can work with the Trump administration by working on veterans' legislation and other bills that the president has signed.

Trump appears to have put Tester in his crosshairs after the Montana Democrat helped sink the confirmation of the president's first nominee to run the U.S. Department of Veterans Affairs, Ronny Jackson. Trump vowed then that Tester would pay at the polls, and he and his surrogates have since visited Montana six times in support of Rosendale.

On Saturday, the Trump campaign announced the president would be holding his third rally in Montana in support of Rosendale on Thursday.

The debate was the second meeting between Tester and Rosendale, and it illustrated how chippy the campaign has become.

The sharpest exchange between the two men came when they were questioned about television ads that illustrate the negative tone that has come to dominate the campaign: Tester accusing Rosendale of being "all hat, no cattle," and Rosendale saying Tester "invented the media circus."

That prompted both candidates to make broadside attacks on the other. Rosendale accused Tester of being the deciding vote in passing the Affordable Care Act, of not backing Trump or the president's tax cuts and of supporting sanctuary cities and open-border policies.

Tester accused Rosendale of wanting to sell off public lands, kick people with pre-existing conditions off health care, privatize public schools and add dark money to the political system.

Each accusation contained some truth, but didn't tell the whole story.

Tester was one of 60 people in the 100-member Senate to vote to pass the Affordable Care Act in 2010, and the bill needed 60 votes to avoid a Republican filibuster. Tester says he is for securing the southern U.S. border with a combination of a wall, technology and manpower, and that the $2 trillion added to the national debt was too high a price for Trump's tax cuts.

Rosendale once supported selling land owned by the federal government, but he no longer does. He said he supports a full range of health insurance options, including short-term insurance plans that don't cover pre-existing conditions, and that education decisions should be made at the local level.

The third candidate in Saturday's debate, Libertarian Rick Breckenridge, lamented the negativity. He said nobody has ever seen a negative ad by a Libertarian.

"These are ideological accelerants that they use to activate their base," Breckenridge said. "The angrier they can get them, the more fired up that they think their base can get."

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