Diarra started his career with Greek side OFI Crete. Then he went to Vitesse Arnhem. He played for French club Lyon from 2002 until 2006 and formed a successful midfield partnership with Michael Essien. He won four Ligue 1 titles during his time at Lyon, playing a key role in the teams success.
After Real Madrid coach Fabio Capello asked President Ramón Calderón to sign three players, "Diarra, Diarra and Diarra", Real Madrid joined Manchester United in the race to sign Mahamadou Diarra. Lyon said that Diarra could not leave and put a €40 million price tag on him. On 18 May 2006, Real Madrid agreed a fee of €26 million. On 22 May, Diarra was unveiled at the Santiago Bernabéu by Calderón and was assigned the number 6 shirt.
In 2006–07, Diarra was a staple player in Fabio Capello's two-defensive midfielder system. He played in 33 of Madrid's 38 matches, scoring three times. On 18 June 2007, with Real Madrid needing to win against Real Mallorca to win the league title for the first time since 2003, Diarra scored an 81st-minute header to give Madrid a 2–1 lead. In the 84th minute, José Antonio Reyes scored a third goal to ensure Real Madrid were champions.
Diarra played a pivotal role in the 2007–08 title defence under new coach Bernd Schuster, and he established himself as the first-choice defensive midfielder, causing teammate Fernando Gago to play higher upfield. Real Madrid comfortably won the league, finishing 8 points clear of second placed Villarreal. Diarra had now been a league champion for 6 consecutive seasons, after winning Ligue 1 with Lyon between 2002–03 and 2005–06, and La Liga with Real Madrid in 2006–07 and 2007–08.
In October 2008, while playing an international fixture against Chad, Diarra was stretchered off the field after receiving a blow to his knee. He was rested for a month and made his next appearance in late November, but was forced to undergo surgery after aggravating his knee injury, which ruled him out for the rest of the season. In his absence, Real Madrid signed Lass Diarra from Portsmouth as a replacement defensive midfielder, who was given Diarra's number 6 shirt. After recovering from injury, Diarra only started 8 further matches in two seasons for Real Madrid. In January 2011, it was reported that Diarra would be leaving Real Madrid, and was linked to several clubs including Málaga.
Diarra returned to French football and signed with AS Monaco on 27 January 2011. He made his début in a 0–0 draw against Olympique de Marseille. Diarra left Monaco after the club was relegated to Ligue 2 at the end of the 2010–11 season. After his departure from Monaco, Diarra remained without a club for the first half of the 2011–12 European season, and was linked with moves to the Middle East and English Football League Championship club Doncaster Rovers.
Diarra signed for Premier League team Fulham on 26 February 2012. He agreed to a contract for the remainder of the 2011–12 season, with an option for the 2012–13 season. He made his Fulham debut as a substitute against Wolverhampton Wanderers on 4 March 2012, assisting the fifth goal in a 5–0 win. On 17 March, he made his first start for Fulham in a 3–0 home loss to Swansea City. He scored his first goal for Fulham against Bolton Wanderers on 7 April 2012.
After impressing manager Martin Jol throughout his eleven Premier League games, on 17 May 2012, Diarra signed a new one-year contract at the club, keeping him at Craven Cottage until the end of the 2012–13 Premier League season.
Diarra was one of twelve players released by Fulham at the end of the 2012–2013 Premier League season. Despite his release, Manager Jol remained positive on Diarra and vowed to help him over the summer to continue his rehabilitation.
Diarra re-signed for Fulham on 26 March 2014 on a contract that expired at the end of the 2013–14 Premier League season in an ultimately unsuccessful attempt to help the club survive relegation.
Diarra trained with Championship side Brentford throughout the 2016–17 season and made an appearance for the club's B team on 20 September 2016.
FourFourTwo magazine says that "Diarra provides aggression, tactical awareness, toughness and the discipline that other players simply lack."
Diarra is a practising Muslim. He observes fasting during the Islamic month of Ramadan, he maintains that “every coach has respected my decision.”Lyon
French Ligue 1: 2002–03, 2003–04, 2004–05, 2005–06
Trophée des Champions: 2003, 2005, 2006
La Liga: 2006–07, 2007–08
Supercopa de España: 2008