The District violated the constitutional rights of one of its police detectives when it punished the law enforcement veteran for speaking to a newspaper reporter without authorization, a federal judge has ruled.

U.S. District Court Judge James Boasberg said the city had infringed on William Hawkins' rights when, after Hawkins publicly criticized an anti-crime initiative, it added a record to his personnel file that could affect future promotions and discipline.

"The District ... violated the First Amendment by disciplining him for speaking to The Washington Post," Boasberg wrote in his 23-page ruling, which was issued Monday.

Hawkins, who joined the Metropolitan Police Department in 1990, came under the agency's scrutiny after he spoke to a reporter about Chief Cathy Lanier's "All Hands on Deck" program in 2009.

"There are burglaries and serious assaults and armed robberies that are set aside because of [the program]," Hawkins told the newspaper. "Detectives should be exempt because it jeopardizes cases."

Hawkins contended that he was speaking as a representative of the District's police union, not as a part of his official activities.

After the story was published, though, the department said Hawkins had broken the department's rules by talking to a journalist without the approval of his supervisor or an agency spokesperson.

The department initially planned to issue a "dereliction report," but Lanier ultimately opted to add a less severe "documentation of counseling" to Hawkins' personnel file.

But Hawkins argued that even the lighter sanction could still hurt his career, and Judge Boasberg agreed that it amounted to an "adverse action."

Lanier disputed that after Boasberg's ruling.

"It is my understanding that the officer received a letter of counseling for violating a long-standing general order regarding interviews with the media," Lanier said Tuesday. "These are not considered discipline by the department and are important in the supervision of employees."

A spokesman for D.C. Attorney General Irvin Nathan said Tuesday that the city was reviewing the ruling and "considering our response in court."

But the police union's chairman celebrated the ruling as a landmark event for police officers and other public employees, who he said are "no longer muzzled."

"Government employees who become aware of bad behavior and want to speak out, they have a way to do that," said Kristopher Baumann. "They didn't have a way to do that before this case."

Hawkins also sought to overturn the department's restrictions about contact with journalists, but Boasberg found that the agency's rules cover "conduct that falls outside of the First Amendment's shelter."