Washington Post reporter Wesley Lowery was detained by police in August 2014 while reporting on the unrest in Ferguson, Mo., following the fatal shooting of Michael Brown by police. (The Washington Post)

Missouri’s St. Louis County has agreed to drop charges against a pair of reporters who were arrested in 2014 while covering protests in Ferguson, Mo., concluding a nearly two-year-long drama that unfolded in the aftermath of the fatal police shooting of Michael Brown.

Wesley Lowery of The Washington Post and Ryan Reilly of the Huffington Post were arrested Aug. 13, 2014, by police who were clearing a Ferguson McDonald’s in which the two reporters were working alongside other journalists.

Almost a full year passed before formal charges of trespassing and interfering with a police officer were filed against the pair. Those charges were dropped Thursday as part of a settlement in which the two Washington-based reporters agreed not to sue the county over the incident.

“Wesley Lowery should never have been arrested in the first place,” Washington Post Executive Editor Martin Baron said in a statement. “That abuse of authority was made worse with the charges brought a year later, showing a lack of respect for the role of journalists in a free society. We’re pleased to see that the charges are finally being dropped, though we remain incensed at how an excellent reporter was treated.”

Lowery and Reilly were in Ferguson to cover the protests over Brown’s death after the unarmed black teenager was shot by a white police officer, Darren Wilson.

On the day of the arrests, officers first cleared the McDonald’s of its patrons, Lowery said at the time. Journalists were allowed to stay but were warned that their safety could not be guaranteed. Police returned a short time later and instructed the reporters to clear the restaurant, too.

Lowery was arrested while trying to leave and Reilly was arrested while arguing with an officer. The two reporters were placed in a holding cell before being told that all members of the press could leave without any charges being filed.

The county filed the charges against the pair nearly a year after their arrests, with Lowery instructed to appear via a court summons dated Aug. 6, 2015.

“There was great peril to persons and property in August 2014, certainly in the business in which Mr. Lowery found himself that night,” St. Louis County Counselor Peter Krane said in a statement. “The police were responding to a request they help the business close for the night. That led to the encounter with Mr. Lowery and eventually the summons that was issued. The charge was supported by the facts. That having been said, the resolution reached is a reasonable one. Everyone involved is now able to move on from that event of the past to focus on doing good work in the future.”

Lowery said in an earlier statement that the county’s contention could not be further from the truth.

“Ryan and I have maintained from day one that our arrests were inappropriate, and the decision to charge us a year later was outrageous,” Lowery said in a statement. “The decision to drop these charges further confirms what we’ve said all along: We were two journalists doing our jobs who never should have been detained, much less charged. I sincerely hope St. Louis County prosecutors apply their newfound wisdom broadly and cease prosecution of the dozens of others, journalists and otherwise, who still face charges for lawful expression of their First Amendment rights during the unrest in Ferguson.”

Arrest warrants were mistakenly issued for the pair in March and quickly recalled, Reilly said on Twitter at the time.

“This is a situation that really never should have come about if the prosecutors had simply done their job properly and taken a look at the evidence,” Reilly said on Thursday, reiterating a criticism he made in an article published after the charges were dropped. “I don’t think that any prosecutor acting in good faith could have possibly thought that there was probable cause to bring the charges in this case.”

The incident upset many in the journalism community.

“It is ridiculous — not to mention a violation of the First Amendment — for the county to press charges against these journalists for simply reporting the news,” Society of Professional Journalists President Dana Neuts said in a statement after the charges were filed. Bernie Lunzer, president of the Newspaper Guild, called the charges “a gross abuse of power.”

Earlier this month, a group of four journalists who were also arrested in Ferguson during the protests reached their own settlement with the county, which they had previously sued, according to the Associated Press. In their suit, the reporters accused county police of violating their civil rights and unjustly detaining them. The settlement details are confidential.

A request for comment from a St. Louis County official was not immediately returned.