Media playback is unsupported on your device Media caption The footage shows a man wearing a large backpack calmly walking towards St Sebastian's church

Sri Lanka has held its first mass funeral amid a day of mourning for the victims of Sunday's bomb blasts.

The death toll from the attacks on churches and hotels has risen to 321 with about 500 wounded, police said.

A state of emergency is in effect to prevent further attacks.

The Islamic State (IS) group claimed the attack on Tuesday via its news outlet. Sri Lanka's government has blamed the blasts on local Islamist group National Thowheed Jamath (NTJ).

The country's prime minister, Ranil Wickremesinghe, said the government believed there "may be links" to IS.

"This could not have been done just locally," he said. "There had been training given and a coordination which we are not seeing earlier."

A BBC correspondent in Sri Lanka says the IS statement should be treated cautiously. As with previous attacks that the group says it carried out, it has provided no evidence for the claim.

Police have now detained 40 suspects in connection with the attack. A spokesman said they included a Syrian who was arrested "after the interrogation of local suspects".

The mass funeral for about 30 victims took place at St Sebastian's church in Negombo, north of Colombo, which was one of the places targeted in Sunday's blasts. Another funeral service was scheduled for later on Tuesday.

Earlier, a moment of silence was observed at 08:30, reflecting the time the first of six bombs detonated. Flags were lowered to half-mast and people, many of them in tears, bowed their heads in respect.

Image copyright Reuters Image caption The death toll has risen to 321 with around 500 injured

The state of emergency gives police and the military sweeping powers to detain and interrogate suspects without court orders - powers that were last used during the nation's civil war.

The government limited access to Facebook, WhatsApp and Instagram after the blasts.

NTJ, the group named by the government as the main suspect, has no history of large-scale attacks but came to prominence last year when it was blamed for damaging Buddhist statues. The group has not said it carried out Sunday's bombings.

A city in shock

At the scene: Ayeshea Perera, BBC News, Negombo

Negombo is usually bustling but today is very different. Most of its shops and businesses are shut, there is a heavily-armed military presence and the entire city is bedecked in white flags - a sign of mourning.

Everywhere, there is a sense of complete shock. People are discussing what happened in hushed tones. Many take pictures of the banners or try to put up bouquets of flowers between the iron grills on the perimeter of the church.

About 150 people are estimated to have been killed during St Sebastian's Easter Mass.

There are so many funerals to conduct that they are being carried out in batches. Security is tight - people are not allowed to drive within a 1km radius of the church.

St Sebastian's itself is strung with banners. Some have pictures of those who died, others have messages of condolence and condemnation. Huge crowds of people are walking in to pay their respects, many having travelled from outside the city.

But there was tension too. An interfaith event organised by the local mosque to condemn the attacks was cut short after a mob surrounded it armed with poles and knives. They were dispersed by police.

Who could be behind the attacks?

IS claimed the attack on Tuesday via its Amaq news outlet, saying it had "targeted nationals of the crusader alliance [anti-IS US-led coalition] and Christians in Sri Lanka". It provided no evidence for the claim.

Defence minister Ruwan Wijewardene told parliament on Tuesday that NTJ was linked to another radical Islamist group he named as JMI, but he gave no details.

He also said "preliminary investigations" indicated that the bombings were in retaliation for deadly attacks on mosques in Christchurch, New Zealand, in March, but again gave no further information.

NTJ has no history of large-scale attacks but came to prominence last year when it was blamed for damaging Buddhist statues. The group has not said it carried out Sunday's bombings.

Meanwhile, police in Colombo have been placed on high alert and told to search for a lorry and a van suspected to be carrying explosives, the BBC Sinhala's Azzam Ameen reports.

Mr Wickremesinghe said that only Sri Lankan nationals had been arrested in connection with the attack so far, but that some of the attackers may have travelled abroad before the bombings.

Were warnings ignored?

Sunday's attacks have highlighted rifts in Sri Lanka's leadership, after it emerged that authorities were warned about an imminent threat.

Security agencies had been watching the NTJ jihadist group, reports said, and had notified police about a possible attack.

But Prime Minister Ranil Wickremesinghe and the cabinet were not informed, ministers said.

Image copyright Getty Images Image caption Authorities have declared a state of emergency

Cabinet spokesman Rajitha Senaratne said the information was not passed to Mr Wickremesinghe due to a rift between the prime minister and President Maithripala Sirisena.

However, it was not clear on Monday whether Mr Sirisena had been made aware of the warnings.

"Our understanding is that it was correctly circulated among security and police," Shiral Lakthilaka, a senior adviser to Mr Sirisena, told the BBC.

He said that the president had appointed a special committee led by a supreme court judge to investigate what had happened.

How did the attacks unfold?

The first reports of explosions came at about 08:45 local time on Sunday with six blasts reported within a small space of time.

How the Sri Lanka attacks unfolded Sri Lanka is GMT+5.5 Six near-simultaneous explosions at luxury hotels and churches holding Easter mass Image caption: Blast damage at St Sebastian's Church in Negombo. Image copyright by Reuters Three churches in Negombo, Batticaloa and Colombo's Kochchikade district are targeted during Easter services and blasts also rock the Shangri-La, Kingsbury and Cinnamon Grand hotels in the country's capital. Sri Lankan government closes school for two days. Five hours after the initial attacks, a blast is reported near the zoo in Dehiwala, southern Colombo. This is the seventh explosion. View on Twitter An eighth explosion is reported near the Colombo district of Dematagoda during a police raid, killing three officers. Image caption: A member of the Sri Lankan Special Task Force (STF) pictured outside a house during a raid. Image copyright by AFP Sri Lankan government shuts down access to major social media messaging services Sri Lanka's government declares an islandwide curfew from 18:00 local time to 06:00 (12:30 GMT-00:30). View on Twitter Reuters reports a petrol bomb attack on a mosque and arson attacks on two shops owned by Muslims in two different parts of the country, citing police. Nationwide curfew is lifted. A "homemade" bomb found close to the main airport in the capital, Colombo, has been made safe, police say. Image copyright by AFP Death toll leaps At least 290 people, including many foreigners, are now confirmed to have died. More than 500 are injured. Another curfew is imposed from 20:00 local time to 04:00 23 April as a precautionary measure. View on Twitter Police in Colombo have recovered 87 low-explosive detonators from the Bastian Mawatha Private Bus Station in Pettah, the BBC's Azzam Ameen reports. People flee after new explosion Video footage from St Anthony's Shrine, shared by Guardian journalist Michael Safi, showed people running from the area in panic. According to BBC Sinhala's Azzam Ameen, the blast happened while "security forces personnel... tried to defuse a newly discovered explosives in a vehicle". View on Twitter Show More

Police have not yet released details of how many people were killed and wounded at each location.

All the attacks were carried out by suicide bombers, officials said.

Who were the victims?

Most of those who died were Sri Lankan nationals, including scores of Christians attending Easter Sunday church services.

One of the first victims to be publicly identified was Sri Lankan celebrity chef Shantha Mayadunne and her daughter Nisanga Mayadunne, who had posted a picture of the family having breakfast in the Shangri-La Hotel in Colombo shortly before the deadly blast.

Sri Lankan officials said 38 foreign nationals were among the dead, with another 14 unaccounted for. The death toll includes at least eight British citizens and at least 10 Indian nationals.

Media playback is unsupported on your device Media caption Monique Allen was killed in one of the Sri Lanka attacks

Three of Danish billionaire Anders Holch Povlsen's children were killed in the attack, a family spokesman confirmed to the BBC. Mr Povlsen owns the Bestseller clothing chain and holds a majority stake in clothing giant Asos.

China has issued an advisory to its citizens not to travel to Sri Lanka in the near future and the US State Department has also warned of possible further attacks.

Are you in Sri Lanka? Have you been affected by the attacks? You can share your experience by contacting haveyoursay@bbc.co.uk

Please include a contact number if you are willing to speak to a BBC journalist. You can also contact us in the following ways: