This piece comes from a set of 21 lively dance tunes based mostly on Hungarian themes. All of his dances were composed for the piano. Brahms wrote orchestral arrangements for No. 1, No. 3 and No. 10. Other composers have orchestrated the other dances.
Number 5 was based on the csardas by Keler Bela titled "Bartfai emlek" which Brahms mistakenly thought was a traditional folksong.