“I am ashamed I was capable of these really horrible attempts to get attention at that time.”

Hartley Sawyer has been fired from The Flash after tweets containing, racist, sexist and homophobic references resurfaced.

In a statement, the 35-year-old actor – who has played Ralph Dibny / Elongated Man on the superhero drama since 2017 – said he was ashamed that he was “capable of these really horrible attempts to get attention.”

“I regret them deeply. This was not acceptable behavior. These were words I threw out at the time with no thought or recognition of the harm my words could do, and now have done today,” he wrote in an Instagram statement.

Sawyer has deactivated his Twitter account, but the tweets have since circulated online. In them, he jokes about sexual assault, violence against women and holding back writing “mildly racist tweets”.

“I am incredibly sorry, ashamed and disappointed in myself for my ignorance back then. I want to be very clear: this is not reflective of what I think or who I am now. I still have more work to do.

“How I define myself now does not take away the impact of my words, or my responsibility for them. I am very sorry.”

The CW released a joint statement earlier this week with Warner Bros. Television and Berlanti Productions to announced that Sawyer would not be returning for The Flash’s upcoming seventh season.

“In regards to Mr. Sawyer’s posts on social media, we do not tolerate derogatory remarks that target any race, ethnicity, national origin, gender, or sexual orientation,” the statement reads.

Grant Gustin and Hartley Sawyer on The Flash

“Such remarks are antithetical to our values and polices, which strive and evolve to promote a safe, inclusive and productive environment for our workforce.”

Grant Gustin, who plays the title hero on The Flash, said he was “shocked, saddened and angry” when he read the tweets.

On his personal account, The Flash showrunner Eric Wallace said he’s “committed to bringing permanent change to the work environment on The Flash” and that the show is for all families, including “Black and Brown ones.”

“In order to facilitate this, I will continue to find Black and Brown writers, directors, actors and producers of all genders to help tell Flash stories. Their stories are part of the American narrative, too, and must be heard,” he explained.