Free-agent center JaVale McGee reached an agreement on a contract with the Lakers, league sources confirmed.

McGee, 30, chose the Lakers over reported interest from the Warriors, Thunder and Pelicans. ESPN was first to report the agreement.

McGee, who averaged 4.8 points and 2.6 rebounds per game this past season, probably couldn’t command more from Golden State than the veteran minimum, but terms of his new deal are unclear. The Lakers sent shock waves through the NBA earlier Sunday by agreeing with LeBron James on a four-year, $154 million deal.

When his playing time was sparse last season, McGee stayed late after Warriors practice for games of 3-on-3, worked on defending guards and forwards, and trusted that his patience would be rewarded with more minutes. After his only action in the seven-game Western Conference finals against Houston came late in a 41-point win, he stayed ready, playing a key role in Golden State’s NBA Finals sweep of Cleveland.

In Game 2 of the Finals, McGee went 6-for-6 from the field on five dunks and a hook shot. Three nights later, he needed only 14 minutes in Game 3 to chip in 10 points.

McGee, who became an unrestricted free agent Saturday night, had said that he’d love to return to Golden State. But the Warriors probably don’t need more than one or two prototypical centers. And McGee’s minutes wouldn’t have been used developing Damian Jones, who is primed for a shot at the rotation after two seasons in the G League.

Connor Letourneau is a San Francisco Chronicle staff writer. Email: cletourneau@sfchronicle.com Twitter: @Con_Chron