The Milwaukee Bucks didn't wait long to replace injured shooting guard Khris Middleton, who will be out of action for at least six months as he recovers from surgery to repair a torn left hamstring.

The Houston Rockets have sent forward Michael Beasley to the Bucks in exchange for point guard Tyler Ennis, Bucks general manager John Hammond announced Thursday. The trade was originally reported by The Vertical's Adrian Wojnarowski.

"We’re excited to add a player with Michael’s skill set to our team," said Hammond in an official statement. "He’s someone that we’ve kept our eye on the last few seasons and we’re looking forward to watching him compete throughout training camp and the season. ...

"We wish Tyler the best and thank him for his contributions to the Bucks, both on and off the court."

The deal wasn't a response to Middleton's injury, according to Charles Gardner of the Milwaukee Journal Sentinel, as it was in the works beforehand, though the process was presumably expedited once the Bucks knew how long Middleton would be gone.

Beasley played 20 games in Houston last season after signing March 4, averaging 12.8 points on 52.2 percent shooting, along with 4.98 rebounds and 0.5 rejections coming off the bench. The Bucks will become the 27-year-old's fifth career team. He's already suited up for the Miami Heat, Phoenix Suns, Minnesota Timberwolves, and Rockets.

If Ennis hadn't been traded, he would likely have been buried in head coach Jason Kidd's rotation behind Michael Carter-Williams, newly signed Matthew Dellavedova, and ball-handling swingman Giannis Antetokounmpo. He should have more of an opportunity to compete under Mike D'Antoni, who doesn't have many point guards to work with outside of Patrick Beverley, although James Harden does run the offense most of the time.

Ennis was selected 18th overall in the 2014 draft by the Suns, and is averaging 4.1 points and 2.1 assists in two seasons.