Robert Fidler, 66, built the four-bedroom home in Surrey without planning permission in 2000, hiding the building behind straw bales.
Reigate and Banstead Borough Council argued he is in contempt of court for not demolishing the house.
If its claim is upheld, Mr Fidler could face a jail sentence.
Mr Fidler told the High Court in London he has sold the house at Honeycrock Farm in Salfords to an Indian businessman and that the injunction ordering demolition is invalid.
The hearing is the latest battle in a nine-year fight between Mr Fidler and the council.
The authority first ordered the house to be demolished in 2007. Since then there has been a planning inquiry, several different planning applications and a series of court cases.
Mr Fidler, who is also applying for the injunction to be varied or suspended, told Mr Justice Dove the council's case was based on "lies and deception".
Addressing the council's major development manager, Andrew Benson, he said: "All you want to do is put me in prison.
"The house is beautiful but you are so determined to get your way and destroy my life."
Mr Fidler said that if he demolished the house he would have nowhere to live and his herd of cattle would have to be disbanded.
The council has ruled out allowing the castle to stay, saying it breaches national and local planning rules protecting the green belt.
It said it had not seen sufficient evidence to show Mr Fidler was not the owner and the injunction still applied.
"Ultimately, the council wishes to see the building demolished in accordance with the enforcement notices," said Mr Benson.
The hearing was adjourned until 9 November.
A farmer who is facing jail for refusing to demolish his mock-Tudor castle has told a court the local council wants to destroy his life.