A man who said he was on a "jihad" to avenge U.S. policy in the Middle East made a surprise guilty plea Tuesday to killing a college student in New Jersey and confessed to killing three other people in Washington state in a crime binge that took investigators weeks to connect.

Ali Muhammad Brown, a 34-year-old former Seattle resident, admitted shooting 19-year-old Brendan Tevlin in late June 2014 as Tevlin sat at a traffic light in West Orange, a few miles from Newark.

He also took responsibility for fatally shooting Dwone Anderson-Young, 23, and Ahmed Said, 27, earlier that month in Seattle after they left a gay nightclub, and for the deadly shooting of Leroy Henderson, 30, in the Seattle suburb of Skyway in April the same year. Brown said he killed the two in Seattle because he believed they were gay.

Brown pleaded guilty to multiple charges, including murder, robbery and terrorism. He was the first person charged with terrorism connected to a homicide under a New Jersey law. He has yet to make a plea in the Washington cases.

In his statement to the court, Brown expressed remorse, telling the judge, "The mistake that I made is I thought I was fighting jihad," according to NJ.com .

The plea came as jury selection was underway for his trial. No deal was offered to Brown, who is expected to be sentenced in May to life without parole, Assistant Essex County Prosecutor Jamel Semper said.

"It appeared he wanted to make himself something of a martyr," Semper said. "He is not. He is just an invented killer who destroyed lives and hurt families.

"He was clearly radicalized online and took up arms against the country — his own country that gave him constitutional protections and allowed him to appear in court and throw himself at the mercy of the court."

The killings "were part of an overarching plan to kill Americans" in retaliation for what Brown contended were "millions of lives" the U.S. had taken in the Middle East, Semper said.

In court papers filed in Seattle in 2014, authorities said Brown described himself to detectives after his New Jersey arrest as a strict Muslim who had become angry with the U.S. government's role in Iraq, Iran and Afghanistan. He claimed the government's actions led to the deaths of innocent civilians and children.

In a subsequent recorded interview in New Jersey, Washington authorities wrote, Brown described his idea of a "just kill," in which the target was men unaccompanied by women, children or elderly people.

According to prosecutors, Tevlin, a sophomore at Virginia's University of Richmond, was driving through West Orange on his way to his family's home in nearby Livingston when Brown and two other men, following him in another car, jumped out and surrounded him.

Brown shot Tevlin through the passenger-side window, hitting him 10 times, prosecutors said at the time of Brown's arrest. Tevlin's car was then driven to an apartment complex in West Orange with Tevlin inside, and some of his belongings were stolen.

Brown was found hiding in the woods in West Orange a few weeks after the shooting. After his arrest, prosecutors in New Jersey said results of ballistics tests from the Tevlin shooting were put into a national database and matched with the gun used in the Seattle killings.

Brown is serving a 35-year sentence for an armed robbery committed before the Tevlin murder.