Police have told an Indonesian TV channel that they have arrested three men on suspicion of links to the attacks in Jakarta that killed a Canadian.

Depok area police chief Col. Dwiyono told MetroTV that the men were arrested at dawn at their homes in Depok on the outskirts of Jakarta.

Dwiyono, who goes by one name, says the men are suspected militants and are being questioned over possible links to the attack Thursday that killed seven people.

MetroTV broadcast footage of the handcuffed men being escorted by police.

Thursday's attack in central Jakarta left seven dead, five were the attackers and two were civilians — and Indonesian and a man of dual Canadian and Algerian nationality.

The assault was claimed by ISIS, the first time the group has targeted the world's most populous Muslim nation.

The brazenness of the assault suggested a new brand of militancy in a country where low-level strikes on police are common.

It took security forces about three hours to end the attack near a Starbucks cafe and Sarinah, Jakarta's oldest department store, after a team of militants traded gunfire with police and blew themselves up. An Indonesian man was also killed in that attack.

At about the same time, two other suicide bombers attacked a nearby traffic police booth, killing themselves and an Indonesian man. Moments later, a group of policemen was attacked by two remaining gunmen, using homemade bombs, said Jakarta police chief Maj.-Gen. Tito Karnavian. This led to a 15-minute gunfight, he said.

Twenty people, including an Algerian, an Austrian, a German and a Dutch national, were wounded. The chief of the UN Environment Program confirmed a Dutch man seriously injured in the attack is "fighting for his life" and undergoing surgery.

Karnavian told reporters: "ISIS is behind this attack definitely," and he identified an Indonesian militant, Bahrun Naim, as the man responsible for plotting it. Police believe Naim is in the Syrian city of Raqqa.

Indonesian president Joko Widodo, centre, visits the site of the bomb blast in the Thamrin business district in Jakarta on Jan. 14, 2016. (Wahyu Putro/Antara Foto/Reuters)

Canada and U.S. condemn attacks

Prime Minister Justin Trudeau said Ottawa will help the Indonesian government with "anything it needs from Canada through this difficult time."

"The hearts of Canada and Canadians go out to the people of Indonesia and all the families and victims of these terrible attacks," Trudeau said at an appearance in Kitchener, Ont.

Canada condemns deadly attacks in Jakarta. Thoughts and prayers with victims, their families, friends and the people of Indonesia —@CanadianPM

Foreign Affairs Minister Stéphane Dion said they are collaborating with Indonesian authorities in an attempt to confirm the Canadian's identity.

"Canada will continue to stand by Indonesia and cooperate in the fight against extremism. We offer our full support to the Indonesian authorities during this challenging time," said Dion in a statement.

The federal government updated its travel advisory for Jakarta in the aftermath of the attacks, advising Canadians to remain vigilant, follow the advice of local authorities and avoid the city's downtown area.

Indonesians lay flowers near the police post where the attack took place. (Dita Alangkara/Associated Press)

The U.S. is also condemning the attack "in the strongest terms."

The United Nations Security Council said in a statement that it's concerned at "the continued threat posed to international peace and security by ISIL (Da'esh), Al-Qaeda, and associated individuals, groups, undertakings, and entities."

'We have identified all attackers'

"We have identified all attackers ... we can say that the attackers were affiliated with the ISIS group," national police spokesman Maj.-Gen. Anton Charilyan told reporters, referring to the Islamic State in Iraq and Syria group.

A police armoured vehicle is parked outside the Starbucks restaurant where a series of explosions went off. The attacks took place on a major downtown street in Jakarta, not far from the presidential palace and the U.S. Embassy. (Achmad Ibrahim/AP)

ISIS backers have circulated a claim of responsibility on Twitter. The U.S.-based SITE Intelligence Group said it was also circulated among pro-ISIS groups on the message app Telegram.

Harits Abu Ulya, an expert on militancy who knows Naim, the man Indonesian authorities suspect co-ordinated the attacks, said he expected more attacks.

"This is an indication that he has been learning from the Paris attacks and he has studied the strategy," he said. "I still have doubts about the capability of the local militants to carry out attacks on a bigger scale. But it is a possibility."

It was the first major attack in Indonesia's capital since the 2009 bombings of two hotels that killed seven people and injured more than 50. Before that, bombings at nightclubs on the resort island of Bali in 2002 killed 202 people, mostly foreigners.

Thursday's attack prompted a security lockdown in central Jakarta and enhanced checks all over the crowded city of 10 million.

Security Message for U.S. Citizens: Terrorist Attack in Central Jakarta <a href="https://t.co/vRBHTQYfFA">https://t.co/vRBHTQYfFA</a> —@usembassyjkt

Police discovered six homemade bombs — five small ones and a big one — in the Starbucks building and in another building nearby.

"So we think ... their plan was to attack people and follow it up with a larger explosion when more people gathered. But thank God it didn't happen," Charilyan said.​

Indonesian police take position behind a vehicle as they pursue suspects after a series of blasts in Jakarta. (AFP/Getty Images)

Canadian witness describes attack

Tweets from the account of Jeremy Douglas, a Canadian who is regional representative of the UN Office on Drugs and Crime for Southeast Asia and the Pacific, described a bomb and "serious" exchanges of gunfire on the street outside his Jakarta office.

Douglas was about 100 metres away from one of the explosions, as his car was pulling up to the UN building.

"As I stepped out of the car, the second suicide bomber blew himself up," he told CBC News, calling it a "pretty big explosion."

Douglas said he quickly ducked into his building, trying to reach the 10th floor where his colleagues were locked down.

He heard another blast.

Five hours after the attacks, police declared the area near the Sarinah shopping mall secure. (Beawiharta/Reuters)

"Then there was a series of explosions. I myself heard five," he said. "And then we heard small arms fire in the street in front of the UN."

Starbucks released a statement Thursday, saying it was "deeply saddened by the senseless act that has taken place in Jakarta." The company noted that all its employees were confirmed safe, though one customer was injured.