The Boston Celtics, one of the NBA’s storied franchises, are finalizing a lucrative media rights package with Comcast SportsNet New England that will extend their current deal by 20 years with a big jump in its annual rights fee, as well as give the team a stake in the network.

Multiple sources said that the Celtics and Comcast are close to a long-term media rights deal despite the NBA lockout that has thrown the league into economic uncertainty.

The proposed deal, which could be finalized in the next few weeks, would extend the Celtics’ media deal to 2038 from the current agreement that runs through 2017. In addition, the team would take up to a 20 percent equity stake in the regional sports network (RSN) and receive a healthy increase in its annual rights fee.

The Celtics currently get between $15 million and $20 million annually, which is considered below market for such a strong franchise.