IOWA CITY, Iowa — Convicted armed robber Ronald Dwaine Carnes eluded authorities for nearly 41 years after escaping from a North Carolina prison, living part of the time in the Seattle area. But with the help of facial-recognition technology, investigators say he’s been caught living in northeastern Iowa using the identities of two 5-year-old boys who died in the 1940s.

Carnes, 69, made an initial appearance Thursday in federal court in Iowa on charges of misusing Social Security numbers, aggravated identity theft and being a felon and fugitive in possession of a firearm. Investigators say Carnes spent decades underground after escaping from a now-closed prison in Huntersville, N.C., in August 1973.

Carnes apparently used the identities of Louie Vance and William Henry Cox for years as he traveled from Chicago to Georgia to Washington state to Iowa, according to a complaint filed Monday. He convinced the Social Security Administration to grant him disability and retirement benefits under both names for years. But after moving into a modest brick home in Waterloo, Iowa, last year, investigators say a mistake and new technology ended his run.

Facial-recognition software, used by the Iowa Department of Transportation since 2008, flagged Carnes’ photo after he applied for a license in Vance’s name in March. The smiling face appeared to be the same man — black, 5 feet 11 inches tall and trim, with a mustache and the same large mole or birthmark on his forehead — who had obtained an Iowa license last year under Cox’s name.

Unlimited Digital Access. $1 for 4 weeks.

Investigators soon determined the individual was using the Cox and Vance identities to receive Social Security benefits. Disability payments meant for Cox started in 2003, while retirement benefits intended for Vance began in 2009. They were being deposited into a Boeing Employees Credit Union Account opened when Carnes lived in the Seattle area. He lived in Des Moines and Auburn between 2002 and late 2012.

Investigators served a search warrant at Carnes’ Waterloo home in April, where they found birth certificates for Vance and Cox and other documents, according to court documents. By his bed they found ammunition and a .380-caliber pistol, the same model found near Carnes’ vehicle when he and an accomplice were arrested in the 1970 armed robbery of a convenience store clerk in Winston-Salem, documents show.

Carnes was arrested in April after the warrant and a fingerprint match soon verified his identity, investigators say.

Information from Seattle Times staff is included in this report.