Jazz general manager Kevin O'Connor said the deal came together just before the 3 p.m. ET trade deadline.
O'Connor says the Jazz have some depth at Brewer's position, so they could afford to trade Brewer, their first-round pick from the 2006 draft. Brewer is making $2.7 million this season and will be a restricted free agent this summer.
"We felt like we gain an asset for drafts coming up," Jazz general manager Kevin O'Connor said Thursday. "We felt like we had a lot of players that were similar."
The deal gives the Grizzlies yet another athletic swingman and allows the Jazz to save money.
Utah had a bit of a logjam at Brewer's position. His salary was essentially double that because the Jazz are over the luxury-tax threshold.
O'Connor said the trade won't put the Jazz under the luxury tax penalty, but it does get them closer and gives them some stock in future drafts, possibly as early as next year.
"If we didn't get an asset back we wouldn't have made the deal," he said.
Brewer started all 53 games this season and 80 of 81 last year. He has been starting since his second season in the league and averaged 10.5 points in 266 games for the Jazz.
Brewer's agent, Henry Thomas, said there had been talk about a deal with the Grizzlies for more than a month, but it had died down until the last-minute trade Thursday.
"It was a little bit of a surprise," Thomas said. "I think it's a little too fresh for him to really have a good handle on his feelings right now."
Grizzlies general manager Chris Wallace said Brewer is a winning NBA player.
"Ronnie is an intelligent, versatile player who is an excellent ballhandler and defender," he said.
Chad Ford is an ESPN NBA Insider. Information from The Associated Press was used in this report.