Boston, looking for a starter with Nathan Eovaldi slated to go to the bullpen when he comes off the injured list, also received cash considerations in the deal.
Red Sox president Dave Dombrowski said Cashner would start Tuesday against the Toronto Blue Jays.
The Red Sox added him to the active roster Sunday and placed right-hander Steven Wright on the 10-day injured list with a bruised big toe on his right foot. Cashner will wear No. 48, the team said.
"He's been throwing the ball well. He's a veteran," Boston manager Alex Cora said after the Red Sox lost 11-2 to the Los Angeles Dodgers on Saturday night. "He's been pitching well against some tough competition and we won't change too much."
Cashner, 32, is 9-3 with a 3.83 ERA in 17 starts for the Orioles this season. He's been hot of late, posting a 1.41 ERA in five starts since the start of June.
"He's excited to be here, excited to pitch," Dombrowski said. "Excited to join the club and excited to be a part of the pennant race. As far as what we like, he's been throwing the ball well ... as well as he ever has.
"Definitely gives us an improvement in that fifth spot, where we scuffled for such a long time this year. ... We like a lot of things about him. We think he makes us better."
Cashner has a 55-82 record in 10 major league seasons with the Orioles, Rangers, Marlins, Padres and Cubs. He is in the final season of a two-year, $16 million contract.
"It's definitely exciting. That'll more kick in once you get there," Cashner said Saturday. "You make a lot of relationships in this game. It's just saying goodbye to a lot of people is maybe the toughest thing."
But he can't wait to say hello to his new teammates, pitch for the home team at Fenway Park and settle into a city soaked with tradition.
"They've been a tough team to face, I know that. It'll be really cool," Cashner said. "It's such a rich history with baseball there. David Ortiz has been one of my favorite players growing up. They're still the champions from last year. It'll be fun to help them get to where they want to go."
Baltimore agreed to send Boston $1,777,839 to cover more than half of the $3,354,839 Cashner is still due from his $8 million salary this year. Baltimore also agreed to make contingent payments on some of Cashner's performance bonuses if he should achieve them.
Dombrowski said the team was happy to make the move ahead of the trade deadline.
"We think every game is important," Dombrowski said. "We really have scuffled in that fifth spot to get innings. This changes that at this point. We're embarking on a really important part of our schedule. That was important. We wouldn't have made a deal that we didn't feel comfortable making. I think we have a good pulse on who's available and not available at this time.
"... We have 70 games to play, basically. It gives us a chance to move right away."
The Red Sox sit in third place in the AL East, nine games behind the New York Yankees. They are 1.5 games back in the AL wild-card standings.
Over a 15-day span starting Monday, the Red Sox play 14 games against the Yankees (eight) and the second-place Tampa Bay Rays.
"We like how our club looks, but we've liked how our club has looked for a long time," Dombrowski said. "I think we've played better. We've won five out of six. But we have to continue forward because we've dug ourselves a hole as far as the division."
Romero and Prado, both 17, made their professional debuts in the Dominican Summer League. Romero, an infielder, hit .264 with two home runs in 29 games; Prado, an outfielder, hit .303 with nine steals and 26 runs scored in 33 games.
ESPN's Joon Lee and The Associated Press contributed to this report.