Codeine is a prescription opiate medication that is commonly prescribed for the treatment of pain. It is a narcotic analgesic, which means that it works by binding to opioid receptors in the brain and spinal cord, blocking the transmission of pain signals to the brain. Codeine is often prescribed for moderate to severe pain, and it can be used to treat a variety of different types of pain, including pain after surgery, pain from injuries, and pain from chronic conditions such as arthritis or cancer.