A convicted sex offender from Gwinnett County who disappeared just months after he was released from prison nearly five years ago was arrested over the weekend in Mexico, federal officials said.

Brad Hatter, 58, was taken into custody by Mexican authorities Saturday after spending five years as a fugitive in multiple countries, the U.S. Marshals Service said. Hatter was returned to the U.S. the following day and placed in detention, according to the federal agency.

Hatter was originally arrested in December 2005 in Gwinnett for attempting to meet a 9-year-old girl “for sexual activity,” the Marshals Service said in a news release. Hatter arranged the rendezvous online and was arrested when he went to meet the girl.

In May 2007, Hatter was convicted of attempting to entice a minor and sentenced to nine years in prison, according to the release. He was released from prison in early 2016 to a halfway house but violated the terms by using an unauthorized internet-connected smartphone, according to court documents. He was then sent back to prison to serve the remainder of his sentence and was released in September 2017.

At that point, he was required to register as a sex offender and report to a federal probation officer, the Marshals Service said. He is accused of going into hiding in January 2018, when officials say he stopped fulfilling the terms of his probation.

U.S. Marshals immediately began searching for Hatter but he had left the country, according to federal officials. The investigation led marshals to believe he first absconded to the Philippines before being found more recently in Mexico, where he was working as a teacher.

Hatter was arrested by Mexican authorities “after a brief pursuit,” the release said.