Sergio Jose Martinez, convicted of sex crimes for attacking two women in Portland last year, was sentenced Monday in federal court for illegally entering the United States before the assaults.

The case inflamed the illegal immigration debate and drew national attention to Oregon's status as a sanctuary state. It also highlighted an ongoing dispute between local authorities and immigration agents about when to share information on immigrants held in jail.

U.S. District Judge Robert E. Jones sentenced Martinez to seven years and eight months, plus three years of supervised release, in the federal case. The sentence will run at the same time as Martinez's 35-year state sentence for the attacks.

Martinez had been removed from the country or deported more than 10 times before the two violent assaults in Portland, Assistant U.S. Attorney Leah Bolstad told the court.

The two women who were attacked by Martinez on July 24, 2017, attended his federal sentencing but didn't speak. The women supported the plea deal, Bolstad said.

When the judge asked Martinez if he had anything to tell the court, he said he wanted to verify that he'll serve out his sentence in state prison, Twin Rivers Correctional Institution in Umatilla County, where he's now being held.

The judge said that was correct but pressed if Martinez wanted to apologize.

Turning slightly toward the women sitting in the public gallery, Martinez said, "I do apologize. I wasn't in the right set of mind when I did these crimes.''

Martinez blamed his drug addiction for the assaults and said he started using drugs at age 12. The past year, he said, marks "the longest I've been sober.''

Martinez sexually assaulted a 65-year-old woman after entering her Northeast Irving Street apartment through an open window, threatening her with a metal rod, tying her up with scarves and socks, punching her then escaping with her car.

Hours later, authorities said, he attacked another woman at knifepoint as she was leaving work and walking to her car in a parking garage on Northeast Halsey Street. He forced the 37-year-old woman into her car, but she got out. He then tackled her to the ground and repeatedly bashed her head into the concrete before taking her car, according to state prosecutors.

Martinez, 31, pleaded guilty in December to first-degree sex abuse, first-degree attempted sex abuse, first-degree sodomy, first-degree burglary, two counts of first-degree kidnapping, two counts of first-degree robbery and two counts of second-degree assault.

Martinez will be deported after completing his 35-year sentence. The three years of federal supervised release was issued in case Martinez were to return to the United States after completing that sentence.

"We must stop dangerous criminals with no right to be in the U.S. from returning to our streets and reoffending after completing their state sentences," Oregon's U.S. Attorney Billy J. Williams said in a statement.

Williams said nothing in state or federal law prevents local police and jails from sharing information with federal agents about people in the country illegally who face criminal charges.

Martinez had been arrested and released a half-dozen times from the Multnomah County jail system without notice to immigration officials, who had placed a hold on him. He faced a string of low-level allegations -- including TriMet fare-jumping, failing to appear in court on a trespassing accusation and an escape warrant -- before his final release and the attacks. The sheriff has said he needs a federal criminal arrest warrant signed by a judge to notify immigration officers about an inmate.

"Giving ICE notice that a defendant is in custody on state charges is permitted under Oregon state law and could have prevented these horrific crimes," Williams said. "Oregonians deserve and expect more. As evidenced by this case, effective communication between federal and state law enforcement is imperative to ensure dangerous illegal aliens are identified and deported according to law."

Mat dos Santos, legal director of the ACLU of Oregon, said the ACLU condemns the violent sexual assaults Martinez committed.

"Mr. Martinez' offenses are unrelated to his immigration status,'' dos Santos said in a prepared statement. "Tying these offenses to his immigration status does nothing but appeal to the stereotype that immigrants are dangerous. Instead, research shows that undocumented immigrants commit significantly less crime than citizens born in the United States."

-- Maxine Bernstein