The UK is one of the worst countries in western Europe for press freedom because of new media-muzzling laws and a climate of hostility towards journalists, a new report has found.

The country ranked 40 out of 180 in the 2018 World Press Freedom Index, a report compiled by influential non-profit organisation Reporters Without Borders (RSF). It dropped to that position last year.

The position marks a “staggering” decline for the UK of 18 places since the index began in 2002, RSF said.

As well as western European nations such as Germany, Ireland and France, countries including South Africa, Jamaica, Namibia and Slovakia also outperformed Britain.

Scandinavian countries had the best climates for the free exchange of information, with Norway, Sweden and Finland ranking best in the index.

North Korea held the lowest ranking, below Eritrea Turkmenistan, Syria, China and Vietnam.

A host of recent developments in the UK had threatened the press’ ability to hold powerful people and institutions to account, the report found, including what it called an “alarming” proposal by the Law Commission to replace the Official Secrets Act with an updated Espionage Act.

The move “could make it easy to jail journalists as ‘spies’ for obtaining leaked information and see them jailed for up to 14 years”, the report found.

RFS also criticised the Government over the introduction of the Investigatory Powers Act, saying the new law contained insufficient protections for whistleblowers, journalists and their sources.

Freedom of the press became further imperilled when Home Secretary Amber Rudd threatened to restrict encryption on messaging services such as WhatsApp and announced plans to criminalise the repeated viewing of extremist content, the organisation said.

“Maintaining our ranking of 40th out of 180 countries is nothing to be proud of, and puts us in the embarrassing position of having one of the worst records on press freedom in Western Europe,” RSF UK Bureau Director Rebecca Vincent said. “This is unacceptable for a country that plays an important international standard-setting role when it comes to human rights and fundamental freedoms.

“We must examine the longer-term trend of worrying moves to restrict press freedom, and hold the UK government to account.”

RSF also cited restrictions imposed by both the Conservative and Labour parties on journalists’ access to campaign events ahead of the June 2017 general election.

Likewise, legal action against news organisations such as one launched by Appleby against the BBC and The Guardian over their coverage of the Panama Papers, demonstrated the erosion of the free press, according to RSF.

They are the only two media outlets out of 96 in 67 countries that analysed the documents to be taken to court, it noted.