LOS ANGELES — A Los Angeles police officer is suing the city, alleging he was assigned to desk duty and demoted because he complained about having to meet a traffic citation-writing quota.

Earl Williams filed the lawsuit Friday in Los Angeles Superior Court, alleging he was retaliated against for being a whistleblower against a practice that the suit states violates a provision of the state Vehicle Code. He seeks unspecified damages as well as attorneys’ fees and an injunction banning ticket quotas within the LAPD.

A spokesman for the City Attorney’s Office could not be reached for comment on the lawsuit, one of several that have been filed in the past few years in which LAPD traffic officers claim they are told by management to meet a fixed number of traffic citations. The City Attorney’s Office has previously stated that the department does not have such a requirement.

According to the complaint, Williams reached the rank of Police Officer III in 1994. He was assigned in 2014 to the Southeast Division, where sergeants told the rank-and-file during roll calls that they were not writing enough citations, the suit alleges.

“Plaintiff understood that his supervisors wanted him to write 12 tickets a day,” the suit states.

In January 2014, Williams was assigned to to desk duty as punishment for writing only one ticket on a day a fellow officer gave out three citations, the suit alleges. He was again relegated to desk duty the next month for the same reasons, but this time he was kept off field duty for more than two weeks, according to the lawsuit.

In March 2014, Williams was sent to desk duty a third time after he did not write any tickets on a day a colleague wrote one citation, the suit states.

Williams complained to a Capt. Darryl Ito two months later that he considered the alleged ticket quota policy to be illegal, the suit states. In August 2014, Ito transferred the plaintiff to the West Los Angeles Division, which was 10 miles further from his home and added a half-hour to his commute time, and he was once again assigned to a desk job, the suit alleges.

Williams’ captain at West Los Angeles told him that after speaking to Ito, he chose not put the plaintiff back into the field, the suit states.

Ito was himself sent to the West Los Angeles Division late last year, the suit states. The complaint further states that in retaliation for his complaints about the citation policy the LAPD “initiated two unfounded personnel complaints against plaintiff, placed him on administrative leave and directed him to Behavioral Science Services.”

The LAPD’s Behavioral Science Services implements the department’s psychological services program.

In March, Ito used the two personnel complaints as justification to downgrade Williams to the rank of Police Officer II and transfer him again, the complaint alleges.