Anderson launched and returned aboard Space Shuttle Discovery, spending over 15 days on a resupply mission to the International Space Station.

STS-131 launched on April 5, 2010, at 6:21 am from LC-39A, and landed at 9:08 am on April 20, 2010, on runway 33 at the Kennedy Space Center’s Shuttle Landing Facility. The mission marked the longest flight for Space Shuttle Discovery and its 38th and penultimate flight. It was also the final night launch of a Space Shuttle.

The primary payload was a Multi-Purpose Logistics Module loaded with supplies and equipment for the International Space Station. The mission also removed and replaced an ammonia tank assembly outside the station on the S1 truss. Anderson and crewmate Rick Mastracchio performed 3 spacewalks to complete these operations. STS-131 carried several on-board payloads, the most since STS-107. It was also the last shuttle mission with a crew of 7.