In return, Baltimore acquired veteran second baseman Jonathan Villar, as well as right-hander Luis Ortiz and shortstop Jean Carmona, both minor leaguers.
Schoop, 26, was hitting .244 with 17 home runs and 40 RBIs for the Orioles this season.
An All-Star in 2017, Schoop missed some of the first half of this season with an oblique strain, but he's heated up since the All-Star break. His nine home runs in July are tied for the second-most in the majors behind Matt Carpenter of the St. Louis Cardinals (10) entering Tuesday.
The trade is the second the Brewers have made for an infielder in recent days, following Friday's deal for Mike Moustakas of the Kansas City Royals.The plan then was for left-handed-hitting third baseman Travis Shaw to shift to second base. The 26-year-old Schoop now gives Milwaukee a right-handed option at second.
The Brewers have also played Hernan Perez at second of late. The upside of having so many infielders is having another quality bat available on the bench.
"Really, what it comes down to for us is we think we're getting better and we think we're adding to our overall depth,'' general manager David Stearns said.
In Schoop, Stearns acquired a young player still under contract for 2019. He has a guaranteed $9 million salary for next year.
"We talk about control and in this case it certainly played into the valuation of the player,'' Stearns said.
But the Brewers did not add a starter, which was an area of concern following injuries to Brent Suter (elbow) and Zach Davies (shoulder). Jimmy Nelson (shoulder) remains sidelined after getting hurt late last season.
Stearns said the team could still look to deal in August, though he voiced confidence in a rotation currently headlined by Jhoulys Chacin (10-3, 3.45 ERA).
"I think we've probably had a little bit more confidence in our group throughout this year than perhaps there's been externally and that's fine,'' Stearns said. "Certainly we were open and active to add to that group, but at this point we were unable to do so.''
Signed by Baltimore at just 16 years old, Schoop played parts of six seasons with the club and was an All-Star last year, when he hit .293 with a career-high 32 home runs and 105 RBIs.
"It's difficult,'' Schoop said. "This is the team that gave me the chance.''
The Orioles, meanwhile, entered Tuesday 42 games behind the first-place Boston Red Sox in the AL East.
According to Elias Sports Bureau, the last team to be at least 40 games out of first at the end of July was the 1962 New York Mets (26-76, 43 games out).
Baltimore has traded several big names in recent weeks, with Manny Machado (Los Angeles Dodgers), Zach Britton (New York Yankees), Brad Brach and Kevin Gausman (Atlanta Braves) joining Schoop on the way out.
Villar is in his sixth season in the majors and had an NL-best 62 steals in 2016. He's hitting .261 with 26 runs scored and six home runs in 87 games this season.
Ortiz, a first-round draft pick by Texas in 2014, has a 3.71 ERA with 65 strikeouts in 68 innings for Double-A Biloxi this season. He is the seventh-rated prospect in the Brewers system, per MLB Pipeline. Carmona, 18 and from the Dominican Republic, is hitting .239 with 28 runs scored for Helena of the Rookie League. He was Milwaukee's 14th-rated prospect.
"Villar is a very capable major league infielder who had a great year in 2016. That was an opportunity to add an infielder and then also some young talent, a young pitcher in Ortiz,'' GM Dan Duquette said. "And we really like the switch-hitting shortstop, Carmona.''
Information from The Associated Press was used in this report.