Matthew Ezekiel Stager (U.S. Marshals Service)

A wanted sex offender who disappeared after leaving a federal prison in Virginia was caught Wednesday in the District, police said.

Matthew Ezekiel Stager, 45, was released from federal prison in Petersburg, Va., on Feb. 2 and was supposed to fly to a transitional center in Texas that day, but he never showed up, the U.S. Marshals Service for the Eastern District of Virginia said in a statement. On Wednesday, authorities sought the public’s help in finding him.

About 2:40 p.m., D.C. police officers arrested Stager in the 500 block of 4th St. NW near the Judiciary Square Metro station, D.C. Superior Court and D.C. police headquarters.

A spokesman for the U.S. marshals said Stager was convicted in 1999 in North Carolina for indecent liberties with a minor, a charge that forced him to register as a sex offender.

In 2013, he was convicted of failing to register as a sex offender, a federal crime, and was serving a five-year sentence, the spokesman said.

The Bureau of Prisons allows some offenders to “self-report” when moving from one facility to another, according to the spokesman, but Stager, who was being moved from a medium-security facility to a transitional center near Austin, failed to show.

A Bureau of Prisons spokesman said Stager was headed to a residential reentry center, or halfway house, that would provide programming such as employment counseling that would ease his transition into the community as the end of his sentence approached.

“The only inmates allowed to move without supervision are considered minimal risk,” Jill C. Tyson, chief public information officer for the agency, said in an email.

Stager, who is 5-foot-8, 145 pounds, and has distinctive tattoos, has a history of drug abuse and mental illness, authorities said.