Controversial WPIX-TV News Director Bill Carey announced yesterday he is resigning from the CW station, The Post has learned.

The move comes only a few months after longtime New York news anchor Kaity Tong — testifying at a colleague’s age-discrimination suit against the station — said she believes Carey demoted her to weekend anchor and reduced her pay because she was 65 years old.

WPIX was cleared in the age discrimination suit.

Tong, sources said, in the last few weeks has signed a new multiyear WPIX contract.

The timing of Carey’s resignation is odd, a source said, as creditors are set to soon take ownership of bankrupt WPIX parent Tribune and choose their own team.