Baranov, then a captain, fought in the Spanish Civil War between October 1936 and November 1937, initially commanding a tank company. After a group of Soviet tankers with T-26 tanks and BA-6 and FAI armored cars, led by "Kombrig" Dmitry Pavlov, began to arrive in Spain in early December 1936, the 1st Republican Tank Brigade began forming from the group, and Baranov became commander of its 1st Tank Battalion. When the Nationalist drive on Madrid resumed on 3 January 1937, the brigade was sent to the front, arriving three days later to participate in the Republican counteroffensive. Baranov's battalion fought in defensive battles alongside Republican troops between 6 and 10 January, during which its BA-6s knocked out several Nationalist tanks. In February, Baranov and the brigade were involved in the Battle of Jarama, repulsing Nationalist infantry attacks, but the battle ended in stalemate.