A gunman killed two people and wounded as many as seven others Friday at a bar along Tel Aviv’s most famous boulevard — with witnesses describing him as smiling calmly while spraying bullets at random.

Nati Shakked, co-owner of the Simta bar on Dizengoff Street, said the assailant removed a machine gun from a bag and began “shooting in every direction,” Reuters reported.

One of people killed was identified as Alon Bakal, a manager at the bar, where several of the casualties had been attending a birthday party, Haaretz newspaper reported.

A massive manhunt was underway for the gunman, whose identity was known to security forces, the paper reported.

Dramatic video footage by Channel 10 TV emerged showing the shooter – clad in black and with a backpack – calmly buying what appear to be fruits or nuts in a health-food store adjacent to the bar.

He then returns the items, glances around, places the backpack on some shopping carts, takes out a rifle and unleashes a fusillade outside.

In a separate video, patrons sitting outside a bar are seen scrambling for safety and taking cover.

Defense analyst Alon Ben-David told the TV station that the gunman’s calm demeanor and tactics show he was well trained. He also said a Koran, the Muslim holy book, was later found in the attacker’s backpack.

“It was a terrorist attack, without a doubt,” bar co-owner Shakked told Israel’s Channel 2.

But police said the motive for the attack was not immediately clear.

Cops nabbed a suspicious person on Gordon Street, near the site of the shooting, but authorities continued combing the area for the gunman.

Tel Aviv Mayor Ron Huldai told reporters at the scene that in his opinion, the attack “appears to be a terrorist attack motivated by nationalism.”

“What I know is that an individual came here and opened fire,” Huldai said. “This appears to be motivated by nationalism. Tel Aviv has been a target in the past, and here it is rearing its ugly head again.”

The mayor was asked about reports that the bar catered to the gay community.

“This bar doesn’t have any unique significance for me. It’s a pub on Dizengoff Street. We need to stop being hysterical,” he said. “There was a terrible event here, and we will get through it just as we have gotten through similar ones in the past.”

According to Israeli Army Radio, the Shin Bet — Israel’s internal security agency — said it did not have any warning of an impending attack. There also was no immediate claim by Palestinian armed groups.

An eyewitness described the horrifying scene that unfolded on a bustling afternoon.

“It was a regular Friday, calm as per usual,” said Noah, who didn’t give her last name. “I remember complaining about the sandwich taking a long time to be prepared. Suddenly we heard a gunshot.

“After the second gunshot, a father ran in here with his son and yelled, ‘Get down!’ We still didn’t process what was going on,” she told the Jerusalem Post.

“Suddenly there was a shot toward the coffee shop in which we were sitting,” she said. “Then I saw the gunman standing right in front of me. He had a black jacket, black hair, a goatee, and he was holding his rifle with two hands.”

Noah said she and the others dropped to the floor.

“I remember the smile on his face,” she said. “He shot once again toward the cafe. Suddenly, he fled and people began running after him. People were collapsing because of the stress, but there weren’t casualties where I was.”

There were conflicting reports about the weapon used — with some witnesses describing it as an AK-47, others an Uzi submachine gun and at least one an M-16 assault rife.

Images aired by Israeli media also show a discarded ammo magazine that appeared to be from a Spectre M4 machine gun– a weapon rarely seen in Israel and the Palestinian territories, Reuters reported.

Simta co-owner Dudi Malka described the gunman as a “fairly short, light-skinned man holding an M-16 gun,” Haaretz daily reported.

Malka said the shooter opened fire toward several businesses in the area.

“We ran into the alleys, he continued to shoot at us,” he said. “People who had guns in the area refused to shoot him.”

Paramedic Shani Mizrachi told Haaretz “there was a huge crowd when I got to the scene. Some of the wounded were inside the pub and others lying in the street. I immediately began to assist a man of about 35 who had bullet wounds in his upper body. He was in fully conscious. I gave him first aid and he was evacuated in a serious condition to the hospital.”

Haim Pinto was closing his jewelry business near the bar when the shooting erupted.

“People started running in my direction yelling, ‘Terrorist! Terrorist!’ I saw the commotion and went right back into my store, another girl came in and we hid in the bathroom till the shooting ended,” he told AFP.

Hair salon owner Osnat David said she was outside smoking a cigarette a couple of minutes before the attack began.

“If I were there when it happened I would have been dead,” she told AFP, describing how she hid in her salon’s storage room with a few customers, holding scissors and waiting for the barrage to end.

French tourist Alexandre Lambez was at a cafe across the street before the mayhem.

“I heard gunshots and turned around. I saw people rushing to the back of the cafe. I heard screaming and saw a man shooting,” he told AFP. “I immediately thought of the attacks in Paris.”

This was the first attack in Tel Aviv since Nov. 2, when two people were killed in a stabbing attack.

Israel has seen a wave of Palestinian street attacks since October, sparked in part by Muslim anger over Jewish visits to Jerusalem’s al-Aqsa mosque complex, also sacred to Jews, as well as long-stalled peace talks.

Twenty-one Israelis have died, mostly in stabbings, shootings and car-ramming attacks. At least 131 Palestinians have been killed by Israeli fire, 90 of them identified by Israel as assailants. The rest died in clashes with security forces.

With Post wires