California congressman Duncan Hunter gave up his year-long fight against federal corruption charges and pleaded guilty Tuesday to misusing his campaign funds, paving the way for the six-term Republican to step down.

Hunter changed his not guilty plea at a federal hearing in San Diego on Tuesday in a dramatic reversal.

For more than a year, Hunter had insisted that criminal charges against him and his wife were the result of a conspiracy of the “deep state” meant to drive him from office in the Democrat-dominated state.

Hunter, an early supporter of President Donald Trump, said in a TV interview that aired Monday that he is prepared to go to jail. Outside court he declined to say when he would leave office.

Prosecutor Phil Halpern noted Hunter’s honourable service in the Marine Corps and his place in a family that has been a local political dynasty. But he had a sharp rebuke for the congressman’s claim that the investigation was a politically motivated “witch hunt.”

“No figure, regardless of what office they occupy, should be allowed in this country to cry witch-hunt or fake news and attempt to deflect their criminal wrongdoings,” he said.

Halpern vowed to seek a prison term for Hunter of at least a year, although his plea agreement calls for up to five years.

Money spent on extravagances, extramarital affairs

The change in plea marks the second time this year a Republican congressman who was re-elected while indicted has later pleaded guilty to federal charges.

Hunter, 42, told San Diego TV station KUSI a trial would be tough on his three children.

His wife Margaret Hunter also was charged in the case and in June accepted a plea deal that called for her to testify against her husband. She faces up to five years in prison.

The couple could have faced decades in prison before the plea deals.

Federal prosecutors said the couple spent more than $250,000 US in campaign money for golf outings, family vacations to Italy and Hawaii, tequila shots and airline tickets for their pet rabbit.

Prosecutors also revealed the congressman spent some of the money on romantic relationships with lobbyists and congressional aides.

Margaret Hunter is shown earlier this year after a court appearance. She faces up to five years in prison as part of the scheme. (Dennis Poroy/Associated Press)

Hunter’s departure will mark the end of a political dynasty in Southern California’s most Republican district. He was elected in 2008 after his father represented the district for 28 years.

In October, former four-term Republican Chris Collins of New York pleaded guilty in an insider trading case, a day after he resigned from Congress. He faces a maximum sentence of about four years in prison.

Collins and Hunter were the first sitting members of Congress to endorse Donald Trump for president, doing so on the same day in February 2016.