It crosses Battle Creek numerous times, then leaves Keystone and heads in a general southeastern direction, curving regularly.
East of town, SD 40 curves back to the southeast and enters the Buffalo Gap National Grassland.
Finally, the route curves to the south and crosses the Cheyenne River; doing this, it leaves the Buffalo Gap National Grassland and Custer County, and enters Oglala Lakota County and the Pine Ridge Indian Reservation, becoming BIA 41.
[3] SD 40 was first established along the route from Rapid City to the Minnesota border southeast of Sioux Falls in 1926.
[citation needed] South Dakota Highway 40A (SD 40A) was a short spur route in the east part of Badlands National Park.