The immediate task of the new dynasty was to restore order. Fortunately for Muscovy, its major enemies, Poland and Sweden, were engaged in a bitter conflict with each other, which provided Muscovy the opportunity to make peace with Sweden in 1617 and to sign a truce with Poland in 1619. After an unsuccessful attempt to regain the city of Smolensk from Poland in 1632, Muscovy made peace with Poland in 1634. Polish king Wladyslaw IV, whose father and predecessor Sigismund III had manipulated his nominal selection as tsar of Muscovy during the Time of Troubles, renounced all claims to the title as a condition of the peace treaty.
The early Romanovs were weak rulers. Under Mikhail, state affairs were in the hands of the tsar's father, Filaret, who in 1619 became patriarch of the Orthodox Church. Later, Mikhail's son Aleksey (r. 1645-76) relied on a boyar, Boris Morozov, to run his government. Morozov abused his position by exploiting the populace, and in 1648 Aleksey dismissed him in the wake of a popular uprising in Moscow.
The autocracy survived the Time of Troubles and the rule of weak or corrupt tsars because of the strength of the government's central bureaucracy. Government functionaries continued to serve, regardless of the ruler's legitimacy or the boyar faction controlling the throne. In the seventeenth century, the bureaucracy expanded dramatically. The number of government departments (prikazy
; sing., prikaz
) increased from twenty-two in 1613 to eighty by mid-century. Although the departments often had overlapping and conflicting jurisdictions, the central government, through provincial governors, was able to control and regulate all social groups, as well as trade, manufacturing, and even the Orthodox Church.
The comprehensive legal code introduced in 1649 illustrates the extent of state control over Russian society. By that time, the boyars had largely merged with the elite bureaucracy, who were obligatory servitors of the state, to form a new nobility, the dvoryanstvo
. The state required service from both the old and the new nobility, primarily in the military. In return, they received land and peasants. In the preceding century, the state had gradually curtailed peasants' rights to move from one landlord to another; the 1649 code officially attached peasants to their domicile. The state fully sanctioned serfdom, and runaway peasants became state fugitives. Landlords had complete power over their peasants and bought, sold, traded, and mortgaged them. Peasants living on state-owned land, however, were not considered serfs. They were organized into communes, which were responsible for taxes and other obligations. Like serfs, however, state peasants were attached to the land they farmed. Middle-class urban tradesmen and craftsmen were assessed taxes, and, like the serfs, they were forbidden to change residence. All segments of the population were subject to military levy and to special taxes. By chaining much of Muscovite society to specific domiciles, the legal code of 1649 curtailed movement and subordinated the people to the interests of the state.
Under this code, increased state taxes and regulations exacerbated the social discontent that had been simmering since the Time of Troubles. In the 1650s and 1660s, the number of peasant escapes increased dramatically. A favorite refuge was the Don River region, domain of the Don Cossacks. A major uprising occurred in the Volga region in 1670 and 1671. Stenka Razin, a Cossack who was from the Don River region, led a revolt that drew together wealthy Cossacks who were well established in the region and escaped serfs seeking free land. The unexpected uprising swept up the Volga River valley and even threatened Moscow. Tsarist troops finally defeated the rebels after they had occupied major cities along the Volga in an operation whose panache captured the imaginations of later generations of Russians. Razin was publicly tortured and executed.