Raphael A. Sanchez, 44, pleaded guilty to wire fraud and aggravated identity theft before U.S. Magistrate John Weinberg in U.S. District Court in Seattle. Sentencing was set for May 12 before U.S. District Judge Robert Lasnik.

Wire fraud is punishable by up to 30 years in prison and up to a $1 million fine. Aggravated identity theft carries a mandatory two-year prison sentence and up to a $250,000 fine. Under a plea agreement, the defense and prosecution will jointly recommend a four-year sentence, although Lasnik is not bound by that agreement.

The Justice Department alleged that Sanchez stole the identities of seven people “in various stages of immigration proceedings” to defraud credit-card companies, including American Express, Bank of America and Capital One, out of more than $190,000.

In the plea agreement, Sanchez admitted to using the ICE database to find would-be immigrants whose IDs he could use to obtain the credit cards. He claimed three immigrants as dependents on his 2014-15 tax returns.

Under the plea agreement, Department of Justice public-integrity lawyers agreed not to charge a number of other offenses, but will use them for sentencing purposes.

The agreement was accompanied by a five-page “factual basis for plea” signed by Sanchez and filed with the court by the Department of Justice’s public-integrity prosecutors, outlining a scheme that dated back to 2013. Sanchez — while the chief legal officer for the Department of Homeland Security overseeing all immigration proceedings in Washington, Oregon, Idaho and Alaska — admitted he used the identities of “aliens in various stages of immigration proceedings with ICE” to defraud six banks of at least $190,000.

Using personal information culled from private immigration files, Sanchez would obtain identification and then use it to obtain credit cards in the immigrants’ names. In obtaining Washington driver’s licenses, Sanchez would use his own photograph for men. For women whose identity he stole, he would use “the photograph of a female murder victim published in a newspaper.”

Eight could-be immigrants, all identified only by initials, were listed as victims to Sanchez’s scheme, including a Chinese man whose identity was used to defraud a bank of more than $16,000 in credit card charges.

While using their names and other identifying information, Sanchez had a number of items shipped to his home in Seattle and listed an ICE cell phone on some applications, according to the documents.

Several of the victims were facing deportation or exclusion from the U.S., making them “particularly susceptible to Sanchez’s criminal conduct,” according to the documents. Some of them were “located outside the country” and did not know that Sanchez had charged thousands in their names and wrecked their credit scores.

“Chief Counsel Sanchez admits that the Victim Aliens were vulnerable due to their immigration status,” the pleading say.

Under questioning Thursday by U.S. Magistrate Judge John Weinberg, Sanchez acknowledged that all of it was true.

Sanchez resigned from the agency Monday.

According to a statement released Thursday by defense attorney Cassandra Stamm, Sanchez is “a good person who has made serious mistakes.”

“He has voluntarily surrendered to effectively begin serving his forthcoming sentence of imprisonment today,” the statement said. “Mr. Sanchez looks forward to to fully repaying all those affected by his crimes.”

Sanchez is the second Seattle-based ICE attorney to face legal trouble in recent years.

In April 2016, Jonathan Love, a former ICE prosecutor, was sentenced to 30 days in prison for forging a document to make it look like a Mexican citizen who wanted to stay in the U.S. was not eligible to do so. Love was an assistant chief counsel for ICE in Seattle before his resignation.