Updated

A man pleaded guilty Thursday to plotting an attack on a Seattle military complex with machine guns and grenades.

Abu Khalid Abdul-Latif, 35, agreed to a prison sentence between 17 and 19 years, the U.S. attorney's office in Seattle said. He pleaded guilty to conspiracy to murder U.S. officers and conspiracy to use weapons of mass destruction and is scheduled to be sentenced in March.

Abdul-Latif was arrested June 22, 2011, along with an acquaintance from Los Angeles, when authorities said they arrived at a Seattle warehouse garage to pick up machine guns and grenades to use in the attack. Investigators had set up the buy after a confidential informant alerted authorities of the men's plan.

In conversations the FBI recorded with the help of the informant, Abdul-Latif and his co-defendant, Walli Mujahidh, discussed how they wanted to gun down people in the Military Entrance Processing Station in south Seattle as revenge for atrocities by U.S. soldiers in Afghanistan, prosecutors said. The military complex houses a federal daycare center.

Mujahidh, 33, pleaded guilty in the case in December 2011.

"This defendant plotted to kill American servicemen and women, and other innocent people in furtherance of his extremist views," U.S. Attorney Jenny A. Durkan said of Abdul-Latif in a statement. "The continued vigilance of the community and the work of law enforcement ensured that we were able to successfully disrupt his deadly plan and bring Mr. Abdul-Latif to justice."

Emails to Abdul-Latif's defense attorneys were not immediately returned.

In June, the defense lawyers filed motions seeking to get some of the prosecution's evidence thrown out, saying the government should not have been able to obtain a secret warrant because there was no indication Abdul-Latif was involved in international terrorism. That motion was denied by a federal judge, who said investigators followed proper procedures.

That filing also showed that Abdul-Latif was being monitored by the FBI long before an acquaintance was recruited to take part in the plot reported it to investigators. In late January 2011, an agent ran a records search on Abdul-Latif and his wife, and by the following month, agents were watching Abdul-Latif while he worked as a janitor and while he attended a mosque with his wife and son.

The FBI monitoring occurred just a few months after Abdul-Latif began posting YouTube videos in which he expressed support for Islamist fighters.

Federal authorities and Seattle police have credited the informant with bringing the plot to light. The informant, a repeat felon and convicted sex offender, was paid $90,400 for his cooperation.