BOSTON — Jon Lester tipped his cap after a tribute on the video board and a deafening roar from the crowd at Fenway Park.

“For me, he’s been an underappreciated guy his whole career,” Theo Epstein said a few hours earlier, sitting in Fenway’s visiting dugout.

Visiting dugout?

“It’s weird,” said Epstein, the former Red Sox general manager.

Lester, once the ace of Boston’s staff, used the same word about being back at Fenway for the first time since he was traded in 2014.

The Chicago Cubs’ celebrated visit to Boston this weekend brought back Epstein, Lester and others who had been with the Red Sox. It was a union of two storied franchises that have ended championship droughts – Boston in 2004 and the Cubs last fall.

It also was a reminder of what the Red Sox had in Epstein and Lester, and likely didn’t appreciate enough – at least not by ownership.

Epstein, 43, became general manager of the Red Sox in 2003. A year later, Boston was celebrating its first World Series title since 1918. But Epstein was always operating in the shadows of a much-involved ownership group, including the team president, Larry Lucchino.

Epstein resigned after the 2005 season, fed up with interference from Lucchino. He was lured back by January, apparently assured of less meddling.

Boston won again in 2007, but this was never fully Epstein’s team. After a stunning collapse at the end of the 2011 season, when Manager Terry Francona was quickly dismissed, Epstein left for Chicago. He was named president of baseball operations – a title given nowadays to a general manager who is completely in charge (Dave Dombrowski of Boston has the same title).

In Epstein’s fifth season, the Cubs won their first championship since 1908. All but two players on the roster were acquired by Epstein.

“The fact that we won, obviously it feels good … to the extent that it kind of validates my decision to try a new challenge,” Epstein said. “It wasn’t a foolish thing to leave.”

One of the cornerstones in Epstein’s roster construction was signing Lester as a free agent after the 2014 season, when the Cubs finished 73-89.

“He was our first marquee free agent,” said first baseman Anthony Rizzo, who also began in the Red Sox organization. Esptein traded Rizzo as a prospect to San Diego in 2010, then acquired him for the Cubs in 2012. Rizzo has been a three-time All-Star with Chicago.

“When we acquired (Lester) I believed in what Theo was doing. It kind of let us all know that this is it. It’s time to win,” Rizzo said.

The Red Sox did not think as much of Lester, even though he was the ace of the 2013 championship team. In the spring of 2014, with Lester’s contract ending after the season, Boston offered a contract extension – four years for $70 million.

Maybe the Red Sox figured they could give Lester a low-ball offer because he said he wanted to stay in Boston. But less-accomplished pitchers were getting bigger deals. Cincinnati had just re-signed Homer Bailey (11-12 the year before) to a six-year deal worth $105 million.

When it became clear Lester would not re-sign with Boston – and with the Red Sox headed for a last-place finish – he was sent to Oakland at the trade deadline.

The Red Sox owner, John Henry, was filmed talking to Lester in the Fenway parking lot before Lester left for Oakland. The belief was Boston would get Lester back as a free agent during the offseason.

But the Cubs also wanted Lester. Epstein made his pitch.

“Jon did some amazing things with the Red Sox – winning the last game of the ’07 World Series … being so integral to the ’13 championship. But he could never turn back time and be part of that ’04 team that changed history,” Epstein said.

“Chicago was the one place that afforded him that opportunity. Being part of history and part of that legacy, I think, really appealed to him.”

Lester, who once said “I don’t like change,” also felt his heart being tugged toward Boston. “There are a lot of special memories here.”

But it wasn’t just the Cubs making an offer to Lester. It was Epstein.

“That helped,” Lester said. “You buy into what Theo has to say, his belief and his guys.”

He signed with Chicago for six years at $155 million.

And as Henry would discover, you have to pay for an ace.

Twelve months later, he signed free agent David Price to a $217 million, seven-year deal.

Price was 17-9 with a 3.99 ERA last year. He’s on the disabled list now with elbow trouble – with concerns that he might not be ready to pitch for a long time, or even need surgery.

Lester was 19-5 with a 2.44 ERA last year, with a 3-1 mark in the postseason.

“So cool for me to see him come full circle, from being that young kid who didn’t know his way in the game and had to be led by others, to being the leader, showing people the right way to do things,” Epstein said.

“He was such a key part to bringing that ’04-type’ championship to Chicago. I’m proud of him.”

Epstein appreciates Lester, as do the Boston fans who showed their affection for him Friday night. But when Lester tipped his cap to the crowd, it was from the visitor’s dugout.