“I am getting a lot of pressure to play this part,” Jake Gyllenhaal said on stage at Boston Medical Center’s 2016 Boston Marathon pasta dinner on Sunday night. “But I love that pressure. I love this city.”

For nearly a month, the actor has been filming Stronger, a Hollywood feature (not to be confused with Mark Wahlberg’s film Patriots’ Day) based on Boston Marathon bombing survivor Jeff Bauman’s autobiographical book of the same title. Gyllenhaal plays Bauman, a man he called “a triumph in just this unspeakable situation.”

Three people were killed and more than 260 were injured near the Boston Marathon finish line in 2013. Bauman, a Chelmsford native, was among those injured.

His photograph — with Carlos Arredondo, otherwise known as the Man in the Cowboy Hat, who helped saved Bauman — was one that resonated all over the country. Bauman lost both his legs that day, was treated at Boston Medical Center, and played a role in identifying the bombers. Ever since, Bauman’s been somewhat of a local figure of courage and strength — the incarnation of “Boston Strong.”

“I also just think that today — I mean [Jeff and I] talked about it — things that happened like this [tragedy] happen a lot — or a lot more — in the world,” Gyllenhaal said on the red carpet before the pasta dinner. (He and Bauman were named honorary co-captains of BMC’s 2016 Marathon team.) “I think putting hope out there and positivity out there, given the state of the world as it is, is the most important thing that we can do. I know both of us feel that responsibility.”

Bauman, alongside Gyllenhaal on the red carpet, explained that, for his role, Gyllenhaal “wants to know so much about the prosthetic world.”

“You’re like a nerd, I consider you like a doctor of prosthetics.” Bauman said to Gyllenhaal. “He’s so good at, you know, acting.”

Though Gyllenhaal is from Los Angeles, he said he spent his childhood summers in Cape Cod. His best friends are from Boston. He’s a self-proclaimed Celtics and Patriots fan. And both Bauman and Gyllenhaal are throwing out the first pitch at the Red Sox game at Fenway on Monday.

“This side of the country and this part of the world is probably the dearest to my heart,” Gyllenhaal said. “Being in Boston itself, I’ve never spent as much time in the city. But we’ve been shooting everywhere. I love the South End and I love Back Bay —“

“And Chelmsford,” Bauman joked.