The Kansas City Police Department apologized on Twitter after transphobic messages were posted to the account over the weekend, the Daily News reported on Sunday.

The tweets came during a social media campaign called "tweet-along," which mimics police ride-alongs. The 58,000 or more followers of the force got a look into the jobs of on-duty officers and their engagements.

Officers stopped to talk to a "possible prostitute," according to Twitter, on Friday night. They suggested she try working at a Sonic fast-food restaurant, which had a help wanted sign in the window, as an alternative to being a sex worker.

When they began to question her gender, that's when the controversial tweets began.

"Wait. That prostitute, was in fact, a man. Not doing anything against the law at present so they let him/her go," a tweet read.

Critics on social media said this isn't the first time the force had disrespected the trans community and expressed displeasure towards the messages.

"The @Kcpolice regularly target and harass trans women. This is not an isolated incident," user Wick Trick said.

The department issued a public apology on Sunday saying that they posted a tweet that was offensive to the LGBTQ and Kansas City community and that they were sorry. They also deleted the tweets that caused the outrage.

"KCPD works tirelessly to educate ourselves on and serve all of our community. We're committed to building culture of respect and inclusivity,"  the department said. "We regret any hurt that may've caused. It conflicted [with] our values [and] we look forward to fostering relationships [with] dialogue [sic] and respect.

The Kansas City officers also said they approached the woman because of how transgender sex workers are victims of violence at alarmingly high rates. This is one of a number of tweet-alongs the squad has done since 2012.