The striatum as the main entry nucleus of the basal ganglia is long known to be critical for motor control. It integrates information from multiple cortical areas, thalamic and midbrain nuclei to refine and control motion. By tackling this incredible variety of input signals, increasing evidences showed a pivotal role, particularly of the dorsal striatum, in executive functions. The complexity of the dorsal striatum (DS) in its compartmentalization and in the nature and origin of its afferent connections, makes it a critical hub controlling dynamics of motor learning and behavioral or cognitive flexibility. The present review summarizes findings from recent studies that utilize optogenetics with complementary technologies including electrophysiology, activity imaging and tracing methods in rodents to elucidate the functioning and role of discrete regions and specific pathways of the DS in behavioral flexibility, with an emphasis on the processes leading to initial action sequence or serial order learning and reversal learning. Introduction: Executive functions consist of multiple high-level cognitive processes that include planning, problem-solving, decision-making, working memory, strategy evaluation or behavioral control and adaptation. The latter can be defined as behavioral or cognitive flexibility, which is a broad concept that refers to the ability to adapt one's cognitive representations, and hence behavior, to environmental changes, which is essential for daily living and often survival. Behaving in a flexible manner requires multiple operations involving inhibition of old pre-learned responding, search for novel effective strategies and maintenance of these new strategies. The concept of behavioral flexibility emerged from animal learning studies (Dickinson, 1981) in which animals face choices influenced by future reward outcomes. There are different assays to measure behavioral flexibility in human and nonhuman primates, as well as in rodents, using reversal learning, strategy-or set-shifting, or inhibitory control or self-control tasks. Reversal learning allows to measure a simpler form of behavioral flexibility entailing shifts between different stimulus-reward associations within one dimension (Iversen and Mishkin, 1970; Dias et al., 1996). Classically, a dominant strategy is formed and must be reversed due to changes in reward contingencies. First, a conditional stimulus is associated with a response leading to a