López's contract was purchased by the St. Louis Cardinals from Mexico City on October 26, 1977. He joined the Springfield Redbirds of the Class AAA American Association for 1978, but returned to the major leagues during the 1978 season, earning a 4–2 record with the St. Louis Cardinals. After one season in St. Louis, López was traded to the Detroit Tigers with Jerry Morales for Jack Murphy and Bob Sykes. López posted some of his best individual statistics in the 1979 season, when he had a 10–5 win–loss record, 106 strikeouts, and a 2.41 ERA (an Adjusted ERA+ of 181). He was third in the AL in saves (21) and seventh in the Cy Young Award voting. López earned another 21 saves in 1980. In the 1981 season, he shared closer responsibilities and collected only three saves before the 1981 Major League Baseball strike ended the season.