On Thursday, a gunman stormed the office of a local newspaper in Annapolis, Md., killing at least five people and injuring two others. According to my colleagues, the attack “likely is the deadliest involving journalists in the United States in decades.” Police have said the attack targeted the newsroom and that the man arrested in the case had assailed the paper on social media after he sued it for defamation and lost.

Thursday’s violence served as a stark reminder that it has become increasingly dangerous to be a journalist around the world.

At least 41 journalists have been killed this year, according to data from the Committee to Protect Journalists. At least 30 of those killed were journalists who were slain for doing their work, or were caught in the crossfire while taking risks to report a story. That total does not include the five who died in Annapolis on Thursday.

Beyond the violence, there has been a remarkable decline in press liberty worldwide. In April, Reporters Without Borders released its annual World Press Freedom Index, which yielded disheartening results for journalists and press-freedom advocates. The organization, known by its initials in French as RSF, found “growing animosity towards journalists” as authoritarian and democratic leaders alike successfully discredited and undermined the press.

“The climate of hatred is steadily more visible in the Index,” RSF said in its report. It pointed to hostility toward the media seeping into non-authoritarian countries, such as the United States. “More and more democratically-elected leaders no longer see the media as part of democracy’s essential underpinning, but as an adversary to which they openly display their aversion,” the report added.

This story is more than numbers. The danger for journalists who receive threats and harassment while reporting is growing. Increasingly, journalists face Internet bullying, criminal charges and even death for doing their jobs. The case of Indian journalist Rana Ayyub is illustrative. After journalist Gauri Lankesh was murdered on her doorstep, Ayyub took to Twitter to point out that Lankesh had just published a book accusing Indian Prime Minister Narendra Modi of complicity in riots in 2002. She called Lankesh’s killers cowards. Since then, as The Post reported, Ayyub has been the victim of a harassment campaign that has dubbed her an “ISIS sex slave” and superimposed her face onto pornography.

In May, a number of U.N. rapporteurs released a statement saying they were “highly concerned” for her life.

In Mexico, Carlos Dominguez, an opinion columnist who wrote about gang violence and politics, was stabbed 21 times while waiting at a stoplight with his family.

The February murder of 27-year-old Slovak journalist Ján Kuciak, who was investigating government corruption, sparked mass protests in the country and the eventual resignation of its prime minister.

The year 2017 was named the most dangerous to be a journalist; a record 262 journalists were jailed, and 48 were killed in connection with their work, according to the Committee to Protect Journalists. And with 41 members of the media already killed this year, it looks as if 2018 will continue the trend.