SEATTLE - A mentally ill petty thief pleaded guilty Thursday to federal charges that he joined another man in planning to attack a Seattle military recruiting station with machine guns and grenades - a plot inspired by the 2009 massacre at Fort Hood, authorities say.

"Why don't we all just go into there with guns blazing and just lay everybody down?" Walli Mujahidh said in one conversation recorded by investigators.

The Los Angeles man faces 27 to 32 years after pleading guilty to three charges: conspiracy to kill officers of the United States, conspiracy to use weapons of mass destruction, and unlawful possession of a firearm.

"The FBI is pleased that Mr. Mujahidh accepted responsibility for his actions, but this case remains a chilling reminder that there is constant work to be done," said Laura M. Laughlin, special agent in charge of the agency's Seattle office.

Mujahidh, 33, has a long history of "chronic, relentless" mental illness, including 12 stays at psychiatric hospitals, said his attorney, Michele Shaw. He has been diagnosed with schizo-affective disorder with bipolar tendencies, she said.

Mujahidh was arrested in June after taking a bus from Los Angeles to Seattle to participate in the attack. He and his codefendant, Khalid Abdul-Latif of Seattle, were arrested in an FBI sting when they arrived at a warehouse garage to pick up machine guns to use in the attack, authorities said.

The man who was to supply them with the weapons had alerted Seattle police about the plot, and continued acting as a confidential police informant.

Authorities say the defendants were influenced in part by the massacre at Fort Hood, Texas, where Nidal Malik Hasan, an Army major, killed 13 people in November 2009.

The alleged target, the Military Entrance Processing Station in Seattle, was a recruiting station for all military branches. The pair initially planned an attack on Joint Base Lewis-McChord, but later shifted to what they considered an easier target, authorities said. Mujahidh confessed shortly after his arrest.

Abdul-Latif is also known as Joseph Anthony Davis, and Mujahidh is also known as Frederick Domingue Jr.

Abdul-Latif is scheduled to face trial in May. Mujahidh is due for sentencing in April. Prosecutors did not divulge how the suspects became acquainted, though Mujahidh formerly lived in Seattle.