The 30-year-old Darvish is a four-time All-Star. He is 6-9 with a 4.01 ERA in 22 starts this season as he comes back from Tommy John surgery.
Darvish is 0-5 with a 5.81 ERA over his last eight starts. He was tagged for a career-worst 10 runs in his last outing, and later revealed that he was tipping his pitches to the Marlins.
The Japanese star would have been free agent at end of the season, his sixth in Texas. He missed the entire 2015 season while recovering from elbow surgery.
Dodgers rookie first baseman Cody Bellinger tweeted a greeting to Darvish even before the deal was official.
The Dodgers have the best record in the majors while Texas has struggled below .500.