Several others were injured in the incident which took place at the Ukhiya refugee camp around 4.15 am on Friday, said Superintendent of Police Shihab Kaiser Khan, chief of 8 Armed Police Battalion.
It comes within a month of the killing of prominent Rohingya leader Mohib Ullah.
The dead include students, teachers and volunteers at the Darul Ulum Nadwatul Olama Al Islamia madrasa, situated at H 52 block in the camp.
They were identified as madrasa teachers Md Idris, 32, Hamidullah, 55 and Nur Alam Halim, 45, students Ibrahim Hossain, 24, Azizul Haque, 22 and volunteer Md Amin, 32.
Another student, Nur Kaiser, 15, has been admitted to hospital with severe injuries, said Ahmed Sanjur Morshed, chief of Ukhiya Police Station.
The injured were subsequently taken to MSF Hospital near the camp.
"The situation is under control now. Additional police personnel have been deployed to the camp. We arrested one person carrying arms," said Shihab.
In a statement, ABPn referred to the attackers as 'Rohingya miscreants'. At least four Rohingya refugees were killed at the scene, while three others died in hospital, according to the ABPn.
A video footage showed a pool of blood on the madrasa floor as families bereaved the deaths of their loved ones.
Police have arrested a suspect, identified as Mujibur Rahman. ABPn recovered a gun, 6 rounds of ammunition and a knife from him.
On Thursday night, Moynarghona police raided local Madutul Ummah Madrasa and the nearby areas along with other camps. Darul Ulum Nadwatul Olama Al Islamia madrasa was attacked one and a half hours later.
Rohingya refugee camps in Cox's Bazar, the biggest of their kind in the world, have been roiled by gunfights and clashes on many occasions. Police described these incidents as robbery or smuggling cases.
The issue of rival Rohingya factions vying for dominance in the camps, however, has drawn focus both at home and abroad following the death of Rohingya leader Mohib Ullah.
Mohib Ullah was shot dead on Sept 29 at Lombashiya Camp in Kutupalong. He was the chairman of the Arakan Rohingya Society for Peace and Human Rights.