FRAMINGHAM – A Framingham Police detective, placed on leave earlier this year, has filed a federal lawsuit against Police Chief Ken Ferguson and the town claiming they are retaliating against him for filing a corruption complaint with the FBI.

Detective Matthew Gutwill, who was placed on leave in August, filed suit in U.S. District Court on Friday alleging his civil rights were violated and a violation of the Massachusetts Public Employee Whistleblower statute.

According to the complaint, about a year before he was placed on leave, Gutwill “made himself very unpopular with a certain segment of the FPD,” when he claimed a fellow detective knowingly lied under oath while testifying in court.

An internal affairs investigation determined that Gutwill was right, but Ferguson asked the investigating officer to change their finding, the lawsuit alleges. When the officer refused, a new investigator came up with a contradicting finding, ruling the detective did not lie on the stand, the complaint alleges.

At the same time, Ferguson removed Gutwill from a federal task force he was working on, claiming that the federal Drug Enforcement Agency asked for him to be removed. Gutwill’s complaint calls that a lie.

“Chief Ferguson was motivated to improperly interfere in the internal affairs investigation because he wanted to cover up a police officer’s perjury and thus avoid additional bad press,” Gutwill’s complaint alleges, referring to the continuing investigation into missing money from the department’s evidence room.

Gutwill met with the FBI in January to discuss what he called the “entrenched practice of tolerating corruption,” within the department, discussing both the allegations of the other officer lying under oath and other departmental problems.

Gutwill told Ferguson in February that he had contacted the FBI.

Ferguson, according to the complaint, was “apoplectic” when he found out, and started a campaign to discredit Gutwill, going as far as opening an investigation against him. After an internal investigation, Ferguson placed Gutwill on leave, claiming that Gutwill lied to the internal investigator. The chief said Gutwill told him he would “blow the place up,” “turn it upside down,” or “something to that effect,” according to an account in the court filing. Gutwill denied ever saying anything like that, the lawsuit says.

Other allegations made by Gutwill included that other Framingham Police detectives allowed informants to buy drugs for themselves after they bought drugs as part of an investigation; detectives took items from crime scenes improperly and hung them as office decorations; an officer was allowed to study for law school while on duty; and attorney Brian Simoneau, the chief’s assistant, was allowed to represent clients in court during work hours and to use department resources for non-department purposes.

Ferguson said he could not comment due to the ongoing case. Town Manager Bob Halpin told Fox 25 there is “an absence of fact in the allegations.”

Halpin also told FOX25, “I can confirm Detective Gutwill is currently on paid administrative leave pending disciplinary action. Earlier this year after allegations made by Detective Gutwill, including that he was being retaliated against, the town conducted an extensive, independent investigation of three allegations made by Detective Gutwill. And in each of the cases, found that there was no validity to the allegations and in fact, in several instances found that Detective Gutwill was untruthful.”

Neither the town nor Ferguson has filed responses to the federal complaint.

Norman Miller can be reached at 508-626-3823 or nmiller@wickedlocal.com. For up-to-date crime news, follow Norman Miller on Twitter @Norman_MillerMW or on Facebook at facebook.com/NormanMillerCrime.