The deputy mayor of Tokyo's Shibuya Ward resigned on Tuesday after facing criticism for mocking a female local assembly member, referring to her as "pig" in an online workplace chat.

Shin Sawada, 63, issued a statement apologizing to Yukiko Kuwazuru, a 35-year-old rookie ward assembly member, for his "inappropriate" posts that "severely damaged" the municipality's reputation.

Shibuya Ward is known for promoting gender equality and diversity, becoming one of the first local governments in Japan to issue certificates recognizing same-sex partnerships as being equivalent to marriage.

According to the municipality, the chat in question was joined by about 120 people, including senior ward officials.

In June and July, Sawada posted messages about Kuwazuru, who belongs to the Democratic Party for the People, calling her "Kuwa-buta." "Buta" means pig in Japanese. He also described an assembly committee to which Kuwazuru belongs as a "group of idiots."

Kuwazuru told a news conference in Tokyo on Monday that she was emotionally hurt and "struggling." She also said Sawada exposed in the chat the address of her residence, that had not been made public.

The incident was brought to light by an anonymous whistleblower who claimed to be an official of Shibuya Ward.

Sawada was serving his second term as deputy mayor of the ward, and also had experience working at major advertising agency Hakuhodo.

Shibuya Mayor Ken Hasebe also apologized on Tuesday, while criticizing Sawada's remarks as "lacking consideration" and "unacceptable."

The mayor also said he instructed workers in the office to "act responsibly as civil servants" to prevent similar incidents from happening again.