A California Democrat locked in a tight congressional race said he made “an honest mistake” when he claimed a nearly $1 million home in Maryland as his primary residence.

TJ Cox, who is running against Rep. David Valadao, R-Hanford, changed his residency status and is willing to refund a $692 tax credit he received from Montgomery County, Md., as a result of the error, the Fresno Bee reported.

The county requires all tax credit recipients to live in their homes for at least six months out of the year.

A spokesman for Cox’s campaign initially said the residency issue was the result of an error by the state, which was found not to be untrue. The Bee provided the campaign with a notarized public document showing Cox initialed and signed a section indicating the home was his primary residence.

“It was an honest mistake that he filled out the principal residence not knowing the legal definitions. His family was living there,” the spokesman said. “That’s just kind of the situation. We are working to get this fixed.”

Cox claimed the three-bedroom, four-bathroom home in Bethesda, Md., as his primary residence in 2016, 2017 and 2018 and also did the same for his home in Fresno.

Cox’s spokesman said he purchased the home for his family to live in while his wife, Dr. Kathleen Murphy, studied public health policy at Johns Hopkins University, the paper reported.

Cox lived and worked in Fresno while his family lived in Maryland, the spokesman said, adding that Murphy and their four children moved back to Fresno about a year ago.

Fallon Patton, a spokeswoman for Maryland’s Department of Assessments and Taxation, said the state documents showing the Bethesda home as Cox’s principal residence were coded based on information filed by Montgomery County during the sale of the home.

Click here for more from the Fresno Bee.