Ryen Russillo and Chris B. Haynes examines why Magic Johnson opted to trade Lou Williams to the Rockets. (1:22)

HOUSTON -- The Los Angeles Lakers have agreed to trade sixth man Lou Williams to the Houston Rockets in exchange for swingman Corey Brewer and an unprotected first-round pick, sources told ESPN, confirming multiple reports.

Williams brings additional scoring to the Rockets' bench, something general manager Daryl Morey said he was hoping to accomplish by Thursday's 3 p.m. ET trade deadline.

The move comes on the heels of the Lakers' naming Hall of Famer Magic Johnson their new president of basketball operations, firing longtime general manager Mitch Kupchak and removing Jim Buss as executive vice president of basketball operations. There has been some question surrounding the Lakers' decision-making process in advance of Thursday's deadline, and sources told ESPN's Ramona Shelburne that Johnson did the deal directly with Houston.

The Lakers had multiple offers for Williams that included a first-round pick in recent weeks, sources told Shelburne. They were so confident in their ability to land a first-round pick for Williams that they offered that pick in discussions for DeMarcus Cousins with the Sacramento Kings on Sunday.

Williams is having the best season of his 12-year career, with highs in points (18.6 per game) and 3-point field goal percentage (.385). He leads the league in scoring off the bench, followed by Rockets reserve guard and newly crowned 3-point shootout champion Eric Gordon. The two have combined for 1,974 points this season.

While Rockets coach Mike D'Antoni liked Brewer's defensive intangibles, he struggled with his shot, something the team couldn't afford to deal with in the postseason. Brewer is averaging a career-low 4.2 points per game and was held scoreless in 13 of the 58 games he has played this season.

Brewer, who was informed after Tuesday's practice that he had been traded, said he was "surprised" by the move and wasn't expecting to be dealt.

"If I was making shots, I would probably still be here, you never know," he said. "I love Houston. I don't want to leave, but I have no choice. I hope my shot starts falling with the Lakers."

Brewer is under contract for next season at about $7.6 million. Asked about being part of Johnson's first Lakers deal, Brewer replied, "He's a great guy. It's his first trade. I guess he likes me, so we'll be good to go."

Despite losing a first-round pick, Houston has two second-round picks in the 2017 draft.

A source told ESPN it is unlikely that Williams will play Thursday night against the New Orleans Pelicans (and newly acquired center Cousins) because of the timing of the physical.

The 30-year-old veteran guard thanked the city of Los Angeles in a tweet Tuesday evening.

Thanx for the love L.A, I've enjoyed my stay. — Lou Williams (@TeamLou23) February 22, 2017

Williams has been to the playoffs six times with three teams, seeing action in 41 postseason contests. He is under contract for $7 million next season.

Information from The Associated Press was used in this report.