Action star Chris Pratt wasn't always in tip-top shape.

The actor gained massive popularity playing the slightly plump Andy Dwyer in the comedy series "Parks and Recreation." Since then, Pratt, 40, has slimmed down while starring in blockbuster flicks.

The "Guardians of the Galaxy" star recently visited "Jimmy Kimmel Live," where he discussed his weight while on the popular workplace comedy.

CHRIS PRATT'S NEW PLEDGE OF ALLEGIANCE-THEMED PRODUCTION COMPANY AIMS TO HEAL POLITICAL DIVIDE

"I remember in the first couple of seasons, just unintentionally, I had gotten a little fat and I was watching the episodes and I was like, 'Oh, God, Chris, you've really let yourself go,'" Pratt noted. "And then I was like, 'but this is some of the funniest stuff you've ever done.'"

Pratt remembered going to Michael Schur, the show's creator, who he told, "I wanna gain like another 30, 40 pounds. He was like 'OK.' And so I did."

He added: "Then it became a challenge. Everyone wanted to see how much I could eat."

Pratt then recounted a scene he filmed for the show in which he was dining at a restaurant with several other people.

"I didn't have anything to say in the scene, so inevitably I wanted to get some screen time, so I decided I would eat one rack of ribs per take," he said. "And if the camera would happen to catch me I would absolutely just be inhaling ribs."

The actor said he filmed12 takes of the scene.

"I went through 12 racks of ribs, which is the equivalent of six pigs. I dined on the ribs of six different pigs," said Pratt, noting that co-star Nick Offerman particularly enjoyed the joke.

"If I can make him laugh, it tickles me to no end," Pratt said. "So, I knew it was making Nick laugh. I was making myself sick, but I had 12 racks of ribs, and then at lunch, because our catering company was creating the ribs, they cooked ribs. And at lunch, I sat down with another four racks of ribs, right next to Nick, and ate the ribs. I got a big laugh."

Since his days on television, Pratt has starred in numerous action films, most recently playing a small role in "Avengers: Endgame." In the interview with Kimmel, he said that he will begin shooting the third installment of the "Jurassic World" franchise "very soon."