“Guardians of the Galaxy” director James Gunn has come under fire for a series of provocative old tweets — prompting him to apologize for his “outrageous” comments.

In one of the many deleted tweets, from 2008 to 2011, Gunn wrote: “I’m doing a big Hollywood film adaptation of The Giving Tree with a happy ending – the tree grows back and gives the kid a b—job.”

In another, he wrote, “The Expendables was so manly I f—ked the s—t out of the little p—y boy next to me! The boys ARE back in town!”

Gunn, an outspoken critic of President Trump, came under fire this week from conservative activists who circulated the years-old, off-color gags.

He issued a mea culpa Thursday night.

“Many people who have followed my career know when I started, I viewed myself as a provocateur, making movies and telling jokes that were outrageous and taboo. As I have discussed publicly many times, as I’ve developed as a person, so has my work and my humor,” Gunn tweeted.

“It’s not to say I’m better, but I am very, very different than I was a few years ago; today I try to root my work in love and connection and less in anger. My days saying something just because it’s shocking and trying to get a reaction are over,” he wrote.

The filmmaker continued: “In the past, I have apologized for humor of mine that hurt people. I truly felt sorry and meant every word of my apologies.”

“For the record, when I made these shocking jokes, I wasn’t living them out. I know this is a weird statement to make, and seems obvious, but, still, here I am, saying it,” he wrote.

“Anyway, that’s the completely honest truth: I used to make a lot of offensive jokes. I don’t anymore. I don’t blame my past self for this, but I like myself more and feel like a more full human being and creator today. Love you to you all,” Gunn tweeted.