The neurocognitive impairments associated with restricted and repetitive behaviors (RRBs) in autism spectrum disorder (ASD) are not yet clear. Prior studies indicate that individuals with ASD show reduced cognitive flexibility, which could reflect difficulty shifting from a previously learned response pattern or a failure to maintain a new response set. We examined different error types on a test of set-shifting completed by 60 individuals with ASD and 55 age- and nonverbal IQ-matched controls. Individuals with ASD were able to initially shift sets, but they exhibited difficulty maintaining new response sets. Difficulty with set maintenance was related to increased severity of RRBs. General difficulty maintaining new response sets and a heightened tendency to revert to old preferences may contribute to RRBs.