An image forming apparatus includes a plurality of image carriers, an intermediate transfer body, a plurality of primary transfer members, a secondary transfer member, a first guide member, and a controller. The first guide member guides a recording medium along a conveying direction. The controller controls a primary transfer bias and a secondary transfer bias. A plurality of the primary transfer members include an upstream side primary transfer member and a downstream side primary transfer member. The controller makes an absolute value of the primary transfer bias applied to the downstream side primary transfer member larger than an absolute value of the primary transfer bias applied to the upstream side primary transfer member. The controller lowers an absolute value of the secondary transfer bias when the recording medium separates from the first guide member.