Chief Roger Gilbert Jr., 43, of Spartansburg, Pennsylvania is a sex offender and had been re-elected to a second term

A registered sex offender who was elected fire chief of a Pennsylvania town has resigned after the news of his prior convictions were revealed .

'My family and our community are being attacked. I didn't want that to continue. All I have done for 18 years is good things. But outsiders are tearing us up. I felt the best thing to do was back away,' Roger Gilbert Jr. told JET24.

Gilbert says as well as resigning as chief, he has also resigned from the fire department.

Gilbert, of Spartansburg was convicted of sexual intercourse with a four-year-old girl in 2001 and completed a five to 10 year sentence for 'involuntary deviate sexual intercourse'.

Gilbert, 43, joined Spartansburg Volunteer Fire Department in 2010 and was recently re-elected to the position of fire chief for a second term, sparking outrage.

The news sparked outcry demanding Gilbert be removed from the position.

Despite the critics, the town mayor Ann Louise Wagner supported Gilbert in his post.

Wagner said she and the volunteer firefighting department are aware of Gilbert's history. The position is unpaid.

'I support the fire department and their decision to have him as chief,' Wagner told The Corry Journal at the time.

Gilbert joined the volunteer fire service (building above) in 2010 and had risen to the highest rank

'The firemen have always elected their own officers and that's how it's always been done. We don't question their decisions,' she said.

However, the victim's mother does not believe Gilbert should be in a post where he could interact with children after his crime in 2000 in the nearby city of Corry.

Gilbert vowed that he has changed.

Spartansburg Mayor Ann Louise Wagner supported Gilbert despite his 2001 conviction of having sex with a four-year-old girl

'That was 20 years ago. You know, the story you are telling kids is once you make mistake, you will be punished for the rest of your life. I've changed my life for the better,' he said to the Journal.

'Every day I get up and try to do good,' he added.

State police said it is up to each individual community to decide whether to allow sex offenders who have completed their sentences to serve in an office at the local level.

Spartansburg is a small town with around 300 residents.

'No grown man that has had intercourse with a four year old should still be alive! Much less fire chief where they are looked to as a refuge from harm,' Terry Sheets wrote on Facebook after Gilbert's history was revealed.

Despite the outcry against him Gilbert said 'I've changed my life for the better' since the crime'

'Why is he even allowed to work in a profession where children are taught to trust and turn to them?!?! His job should NEVER allow him to be in the vicinity of children. SICK,' another user Danielle Card wrote.

Others began to critic the people who elected him to the position.

'He needs to be in prison. What is wrong with the people who elected him? It doesn't say much for the mayor,' Barb Reynolds added.

'WTF!!!!!!! I don't care if it was 50 years ago and if the person was now 100-years-old, he should never be allowed to participate in areas where he has access to children,' user Reta Hull said.