Tuberculosis (TB) is a contagious bacterial infection caused by Mycobacterium tuberculosis. It most commonly affects the lungs and spreads through the air when an infected person coughs, sneezes or speaks. Tiny droplets carrying the bacteria can be inhaled by others, allowing the infection to take hold.