Appearing at Newton Aycliffe Magistrates' Court, Peterlee mayor Lee Cook indicated a guilty plea to trying to meet a boy following grooming.
The 29-year-old became the town's youngest elected mayor earlier this year.
Cook, of Quantock Place, Peterlee, was bailed and will be sentenced at Durham Crown Court on 25 August.
He was ordered to sign the sex offenders register and not to have any unsupervised contact with under-16s.
The North East Party, which Cook was a member of, said in a statement that he had been suspended.
Peterlee Town Council said Cook resigned from the council earlier.
The mayor of a County Durham town is to plead guilty to attempting to try to meet a boy under 16 for sex.