One of Africa’s bastions of press freedom is attempting to enact harsh legislation that threatens journalists reporting on an unfolding security crisis, human rights organisations and press freedom advocates have warned.

Burkina Faso, currently ranked the fifth best African country for media freedom, is attempting to criminalise the “demoralisation” of its defence forces by any means, and the dissemination of information that could “undermine” public order or security operations.

Journalists who share information about military operations could face up to 10 years in jail and £7,000 fines under the new law, which was voted in by 103 out of 127 deputies on 21 June and is awaiting presidential approval.

In an interview with reporters in Ouagadougou, the key government official behind the law, the minister of human rights, Bessolé René Bagoro, said its scope was narrow, but then illustrated his point with an example that appeared to show that any reporting of military losses was prohibited.

“You don’t have the right to give the position of security forces, because that will help the enemy know how we are organising ourselves,” Bagoro said. “Or, for example, if there is an attack and you publish pictures, you say that people are fleeing, the army is losing, you encourage [the enemy]. So it’s very precise.”

Journalists, human rights groups and press freedom advocates in Burkina Faso and internationally have condemned the law as a death sentence for many outlets. Guezouma Sanogo, president of the national journalists’ association, said it was a “grave setback” for press freedom and a return to the censorship of 70 years previously.

“It’s a law that specifically targets journalists,” he said. “It will roll back the little credit that journalists have with the public. We find the procedure through which this law has been adopted very contemptuous.”

The situation in first the north and then the east of the country has deteriorated dramatically over the past four years, and 219,000 people are now displaced. In the north, on the Malian border, the local extremist group Ansarul Islam has carried out dozens of attacks, particularly on state forces, schools and teachers.

This arose partly as a result of the fall of the former president Blaise Compaoré in a popular uprising in 2014, analysts say, because the army was weakened and the powerful Presidential Security Regiment (RSP) disbanded. Others claim that Compaoré cut deals with armed groups in an attempt to immunise the country against attacks in exchange for leaving the groups unmolested .

In the east, ballooning anger with a government perceived as neglectful and exploitative has led to an armed insurgency that researchers say is supported by extremists from the Islamic State in the Greater Sahel, Ansarul Islam, and Mali’s al-Qaida affiliated Nusrat al-Islam– particularly the group headed by Amadou Koufa – but which bears some jihadi hallmarks and not others. Sex workers and alcohol sellers are routinely executed, according to villagers in occupied areas, but Christians and their pastors are allowed to worship, unlike those in the north, where there has been a string of attacks on churches.

Instead of attempting to quell local anger through dialogue and improving services, the government has chosen a military path: Operation Doofu was launched in the north in May. But a Human Rights Watch report said researchers had documented 130 killings of suspects by the Burkinabè security forces, compared with about 60 killings by armed Islamists.

Burkina Faso, the country of the “upright revolutionary” Thomas Sankara, traditionally prizes the freedom of the press, and its citizens tend to be well versed in the country’s affairs and workings of its parliament.

The assassination of Norbert Zongo 20 years ago – an investigative journalist who uncovered government corruption and mismanagement – caused shock, protests and a political crisis. Zongo had begun looking into allegations that the then president’s brother was connected to an unsolved murder.

Before the passage of the new restrictive law, Reporters Without Borders had called Burkina Faso one of Africa’s success stories, praising the west African country’s “dynamic, professional and diverse” media, and ranking it 36th out of 180 countries – a jump from 41st place in 2018.