Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A Milwaukee man was arrested Tuesday on charges that he sought machine guns in order to carry out a terror attack on a Masonic temple, federal prosecutors said.

Samy Mohamed Hamzeh, 23, was charged with unlawfully possessing a machine gun and unlawfully receiving and possessing firearms not registered to him.

Hamzeh allegedly told two informants working with the FBI last week that the three should carry out an attack on a Masonic temple using machine guns equipped with silencers — to kill everyone inside and then escape "as if nothing happened," according to a criminal complaint.

Samy Mohamed Hamzeh, 23, was charged with unlawfully possessing a machine gun and unlawfully receiving and possessing firearms not registered to him. Waukesha County Sheriff

The FBI set up a fake buy Monday and arrested Hamzeh after he paid for two fully automatic guns and one silencer, the FBI said. It wasn’t immediately clear if Hamzeh had an attorney.

"Samy Mohamed Hamzeh devised a detailed plan to commit a mass shooting intended to kill dozens of people He also said that he wanted this mass shooting to be 'known the world over' and to 'ignite' broader clashes," Acting U.S. Attorney Gregory J. Haanstad said in a statement.

"It is difficult to calculate the injury and loss of life that was prevented by concerned citizens coming forward and by the tireless efforts of the FBI and the Joint Terrorism Task Force," Haanstad said.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Hamzeh had been under investigation since September, officials said. In October, a confidential source allegedly told investigators he planned to go to the West Bank and kill Israelis, but decided to conduct an attack in the U.S. instead.

Hamzeh and two informants went to a gun range on Jan. 19 where they fired a handgun, and later toured a Masonic temple, according to the affidavit. The next morning, Hamzeh alleghedly discussed the plan to attack the temple, and the conversation as recorded by the FBI.

"I am telling you, if this hit is executed, it will be known all over the world. ... Sure, all over the world, all the Mujahedeen will be talking and they will be proud of us," Hamzeh said, according to the affidavit.

Hamzeh allegedly predicted the attack would inspire others to cause terror in America. "This way we will be igniting it. I mean we are marching at the front of the war," he said, according to court documents/

Hamzeh allegedly justified the planned attack by saying "we are Muslims, defending Muslim religion," but said they weren’t part of any other terror group, according to court documents.

The Masonic temple that was to be attacked was not named in court documents. Hamzeh allegedly told the two informants that he wanted to attack a Masonic temple because he believed “they are playing the world like a game,” according to the affidavit.

"If I go out, after killing 30 people, I will happy 100 percent ... because these 30 will terrify the world," Hamzeh allegedly said.

The interrupted plot was the second mass shooting planned in the Milwaukee area in 3 1/2 years.

In August of 2012, white supremacist Wade Michael Page opened fire on a Sikh temple in Oak Creek, killing six people. He fatally shot himself in the head after being shot in the stomach by police.