Orioles head of baseball operations Andy MacPhail made the deal - he was president of the Cubs from 1994-2006.
Trachsel returned to the place where he started his major league career. The Cubs sent pitcher Rocky Cherry and infielder Scott Moore to Baltimore for the right-hander.
Players must be with a team by Friday to be eligible for the postseason. The Aug. 31 deadline often produces a late flurry of deals.
The 36-year-old Trachsel was 6-8 with a 4.48 ERA in 25 starts this season. He pitched well this month, going 1-1 with a 2.37 ERA in six starts.
Trachsel played for the Cubs from 1993-99, and later pitched for Tampa Bay, Toronto, the New York Mets and Baltimore. He is 140-151 with a 4.29 ERA lifetime, was an All-Star in 1996 and gave up Mark McGwire's record-breaking 62nd home run in 1998.
The Cubs made their second deal of the month. Earlier, they got outfielder Craig Monroe from Detroit.