Red blood cells (RBCs), also known as erythrocytes, have the primary function of transporting oxygen from the lungs to the tissues and returning carbon dioxide from the tissues to the lungs for exhalation. The oxygen is bound to hemoglobin, a protein found in RBCs. Carbon dioxide is transported in various forms, including bound to hemoglobin or dissolved in plasma.
Thus, the primary function of red blood cells is the transport of oxygen and carbon dioxide.