Gunmen killed at least seven people and wounded 20 in an assault Friday on an Islamic seminary in a Rohingya refugee camp in Bangladesh, heightening tensions in the settlements after the recent shooting of a community leader.

The attackers randomly shot some victims and stabbed others with knives at the Balukhali refugee complex in Cox's Bazar near the border with Myanmar, a regional police chief said.

The killings came as tensions mount in the camps that house more than 900,000 refugees from Myanmar, after a Rohingya activist was shot dead outside his office three weeks ago.

Four people were killed instantly in Friday's attack at the Darul Ulum Nadwatul Ulama al Islamia madrassa.

Three others died at a hospital in one of the camps that make up the Balukhali refugee complex.

Police did not say how many people were wounded but a medic with Doctors Without Borders (MSF) who requested anonymity said about 20 people were hurt.

"About 20 seriously injured people came to our hospital, many with no arms, no legs or no eyes. Their condition is very bad. Three of them died," the doctor said.

Police official Kamran Hossain said "Rohingya miscreants" entered the madrassa before dawn and "randomly hacked and shot people inside".

Security forces sent reinforcements to immediately seal off the camp, which houses more than 27,000 people. Camp residents shared images on social media of bodies on the floor of the madrassa.

"We arrested one attacker immediately after the incident," Shihab Kaisar Khan, regional chief for an armed police battalion, told reporters.

The man was found with a gun, six rounds of ammunition and a knife, he added.

The refugee camp complex houses more than 900,000 people from Myanmar The refugee camp complex houses more than 900,000 people from Myanmar Photo: AFP / MUNIR UZ ZAMAN

Many Rohingya activists have gone into hiding or sought protection from the police and UN agencies since the killing of rights advocate Mohib Ullah by unknown assailants in a nearby Balukhali camp.

The 48-year-old teacher had become a leading moderate voice for the stateless community.

Some activists blamed the Arakan Rohingya Salvation Army (ARSA) for the killing.

ARSA is the militant group behind attacks on Myanmar security forces in 2017 that set off a military clampdown and a mass exodus into Bangladesh by 740,000 Rohingya. It has condemned Ullah's killing in a Twitter statement and denied any involvement.

Police say at least five people have been arrested for Ullah's murder. But activists say there is mounting fear of more violence in the camps.

"Security was tightened after Ullah's death. But in less than a month seven people have been killed. How can we trust the increased security?" said one refugee, Hakim, who asked to use only one name.

Human Rights Watch said in a statement this month that at least a dozen activists have approached the UN refugee agency, the UNHCR, since the killing of Ullah.

Many said they had been threatened by militants.

UN High Commissioner for Human Rights Michelle Bachelet called Ullah's death "a clear example of the insecurity in the camp, and the apparent attempts to silence moderate civil society voices".

Other activists said the camp's narrow streets are taken over by militants and criminals after dark as police barely patrol at night.

"They (police) seem intimidated and reluctant. A serious tension lingers within the camps since Ullah's murder," Kyaw Min, a leader of Ullah's Arakan Rohingya Society for Peace and Human Rights (ARSPH), told AFP in a recent interview.

Bangladesh police have insisted that full security is assured.