At age 18, Cordero was drafted by the San Diego Padres in the 26th round of the 2000 draft, but he chose to enroll at Cal State Fullerton, where he was a standout reliever. With an ERA of under 1.83 he made the 1st team All-America Freshman team and was selected to the Big West All-Conference team, the latter of which he repeated in each of his next two years. In 2003, he was the Fullerton Regional MVP (College World Series), and then was drafted by the Expos in the 1st round (20th overall).
Cordero pitched briefly in 2003, and then appeared in 69 games for the Expos in 2004, compiling an ERA of 2.94, usually appearing as a closer. He was the winning pitcher in the franchise's last Montreal Expo victory, October 2 against the New York Mets at Shea Stadium.
The Expos became the Washington Nationals in 2005, and Cordero had a career best season. In June 2005, Cordero tied the major league record for saves in one month with 15. He shares the record with Lee Smith and John Wetteland. In addition, he also converted his 24th consecutive save, breaking the club record held by Mel Rojas. On September 9, 2005, Cordero's 44th save broke the franchise record. He completed the 2005 season with 47 saves, leading the major leagues, and was selected to the National League pitching staff for the 2005 MLB All-Star game, facing one batter, Iván Rodríguez, and striking him out. He was the 2005 Washington Nationals Player of the Year, and won the National League Rolaids Relief Man of the Year Award.
In February 2006, Cordero and his teammate Brian Schneider were chosen to play for Team USA in the World Baseball Classic. During the season, however, his production tailed off. While he still got 29 saves (8th best in the league), his ERA went from 1.82 to 3.19.
In the beginning of the 2007 season, Cordero faced a tough time against batters. By May 6, his ERA was 4.70. Cordero admitted he was distracted by the illness of his ailing grandmother, and missed six games for personal bereavement leave. He came back a changed man, and starting May 16 made 12 consecutive appearances without allowing a run. On June 13, Cordero (at age 25 years and 86 days) became the second youngest player in baseball history to reach 100 saves in a career. (The Brewers' Francisco Rodríguez is the youngest at 24 years and 246 days old.)
Cordero missed almost all of the 2008 season after undergoing surgery to repair a labrum tear, an injury he suffered in April. On October 30, 2008 the Nationals sent him outright to AAA Syracuse, and he rejected the assignment, becoming a free agent. Among other reasons for Cordero's rejection was that he was displeased with how he found out that he would be "non-tendered" by the Nationals at the end of the season—via an impromptu comment made by Nationals' GM Jim Bowden on a radio show in July.
On March 12, 2009, he signed a minor league contract with the Seattle Mariners with an invitation to spring training. He was to compete for the closer role once he fully recovered from surgery, but was unable to make a minor league appearance until July. He was called up to the Mariners on June 3, 2010, taking the spot of the retired Ken Griffey, Jr. On July 15, 2010 he refused a minor league assignment from the Seattle Mariners and became a free agent. On July 21, 2010 Cordero agreed on a minor league deal with the New York Mets and was assigned to Triple A Buffalo.
On February 13, 2013, he signed a minor league contract with the Los Angeles Angels of Anaheim due to his desire to play again. He was assigned to the Inland Empire 66ers of the California League, the (high) Class-A affiliate of the Angels, to begin the season.