Every breath you take moves your spine, ribs, and dozens of muscles in your trunk, so a back spasm during breathing usually means one of those structures is injured, irritated, or reflexively tightening to protect something that is. The most common culprit is a strained muscle in the rib or mid-back area that contracts involuntarily each time your ribcage expands. But the list of possible causes extends beyond simple muscle pulls, and a few of them warrant urgent medical attention.
How Breathing Actually Moves Your Back
People tend to think of breathing as something that happens only in the chest, but the mechanics reach deep into the spine. When you inhale, your diaphragm contracts downward, your ribs swing outward and upward, and the thoracic spine (the twelve vertebrae between your neck and lower back) extends slightly. The amount of movement is not uniform along the spine. Vertebrae attached to the upper ribs, which connect directly to the sternum, move relatively little. The segments attached to the lower “floating” ribs, which have no front connection at all, move the most.
1Frontiers in Medicine. Non-uniform Segmental Range of Motion of the Thoracic Spine During Maximal Inspiration and Exhalation in Healthy SubjectsThis means that each deep breath creates a small but real mechanical load on your spine, your ribs, the muscles layered between and around your ribs, and the ligaments holding everything together. When any one of those tissues is inflamed, torn, or pinched, the rhythmic movement of breathing becomes enough to trigger a spasm. The deeper you breathe, the more the ribcage and spine move, and the worse the spasm feels.
Muscle Strain and the Pain-Spasm Cycle
The single most common reason for a back spasm that worsens with breathing is a strained muscle. You have three layers of intercostal muscles running between each pair of ribs, plus the paraspinal muscles that run alongside your spine. When any of these get overstretched, pulled, or partially torn, you can feel sharp or dull pain that gets worse every time you inhale, move your torso, cough, or sneeze. The injured area often goes into spasm as well, which limits how far you can expand your ribcage.
What makes this frustrating is the self-reinforcing nature of the problem. When a muscle spasms, the sustained contraction squeezes its own blood supply, reducing oxygen delivery and letting metabolic waste products build up. Those waste products activate pain receptors, which signal the nervous system to keep the muscle contracted, which squeezes the blood supply further. Researchers describe this as the pain-spasm-pain cycle, and it explains why a back spasm during breathing can hang around for days or weeks even after the initial injury is minor.
2PubMed Central. Chronic muscle pain and spasm hallmarks of spinal instabilityCommon ways people strain these muscles include twisting awkwardly during sports or exercise, lifting something heavy with a rotational component, coughing hard during an illness, or even sleeping in an unusual position. Sometimes people cannot identify a single event and the strain developed gradually from repetitive overhead work or prolonged awkward postures.
The Diaphragm’s Role in Back Pain
Your diaphragm is not just a breathing muscle. It attaches directly to the front of the lumbar spine, to the lower ribs, and to the bottom of the sternum. Because of that attachment, it acts as a stabilizer for your lower back. Every time you inhale, the diaphragm pulls on your lumbar vertebrae. If the diaphragm is not working efficiently, the small muscles alongside your spine have to pick up the slack for both breathing and stabilization, and they can fatigue and spasm.
Research on diaphragm training has shown that strengthening the diaphragm also increases the thickness of the transversus abdominis and lumbar multifidus, two deep core muscles critical for spinal stability.
3PubMed Central. The effect of diaphragm training on lumbar stabilizer muscles: a new concept for improving segmental stability in the case of low back painThe takeaway is that the diaphragm and the lower-back stabilizers work as a team. When one member of that team underperforms, the others compensate, and compensation under load is a recipe for spasm.
Nerve Irritation and Spinal Problems
Sometimes the issue is not the muscle itself but the nerve that supplies it. Intercostal neuralgia, or pain along the intercostal nerves that run beneath each rib, can produce sharp, burning, or cramping sensations in the chest wall, rib area, and upper abdomen.
4Ochsner Journal. Cooled Radiofrequency Ablation for Intercostal NeuralgiaBecause those nerves emerge from the thoracic spine, anything that irritates them at their root can refer pain along the entire nerve path. The spasm you feel in your back during breathing may actually be driven by a nerve compressed at the spine rather than a muscle injury at the site of pain.
Thoracic disc herniations are less common than lumbar ones, but they do happen, especially in people who do a lot of rotational loading. A case report of a professional baseball pitcher illustrates the pattern well: the player developed left-sided chest wall pain during a game, and imaging revealed a disc herniation at the T9-T10 level pressing on a nerve root.
5PubMed Central. Unusual chest wall pain caused by thoracic disc herniation in a professional baseball pitcherIn cases like these, every deep breath slightly changes the geometry of the disc and nerve, which is why the pain tracks with respiration.
Spinal instability in the thoracic or lumbar spine can also produce breathing-related spasms. When a spinal segment is unstable, the surrounding muscles reflexively guard it by contracting, even during movements as small as breathing. That guarding reflex is the body’s attempt to prevent further injury to the spine or spinal cord, but the sustained contraction itself becomes a source of pain.
2PubMed Central. Chronic muscle pain and spasm hallmarks of spinal instabilityWhen Breathing Habits Are Part of the Problem
The way you breathe can contribute to or even cause the spasm. Breathing pattern disorders, which range from mild chest-dominant breathing to full-blown hyperventilation, are surprisingly common and create a cascade of problems that reach well beyond the lungs. Hyperventilation shifts your blood chemistry toward alkalosis, which reduces oxygen delivery to tissues, increases pain sensitivity, speeds up spinal reflexes, and makes motor and sensory nerves more excitable. It also promotes the development of myofascial trigger points, those tender knots in muscle that refer pain to other areas.
6Journal of Osteopathic Medicine. Breathing pattern disorders, motor control, and low back painEven without reaching the threshold of hyperventilation, habitual shallow chest breathing forces your accessory breathing muscles (the ones in your neck, shoulders, and upper back) to do work that should be handled mainly by the diaphragm. Over time, those muscles fatigue, tighten, and develop trigger points. This is one reason people who are anxious or stressed often develop upper-back and neck pain that seems to come from nowhere. The stress does not magically create a muscle problem; it changes your breathing pattern, and the altered breathing pattern creates the muscle problem.
Posture, Prolonged Sitting, and Thoracic Stiffness
If you spend hours sitting at a desk, in a car, or on a couch, you are loading your spine in a way that sets the stage for breathing-related spasms. Prolonged sitting creates static loading on the soft tissues of the spine, accelerates disc degeneration, and reduces the mobility of the thoracic spine over time.
7Annual Reviews. Spine ergonomicsA stiff thoracic spine does not expand as freely during inhalation, so the muscles have to work harder to produce the same tidal volume. More effort per breath means more fatigue, and fatigued muscles spasm more easily.
Kyphosis, an exaggerated forward rounding of the upper back, compounds this. Research from the Framingham Study found that greater kyphosis was associated with a larger decline in lung function over a sixteen-year period, particularly in women.
8PubMed Central. Severity of Kyphosis and Decline in Lung Function: The Framingham StudyWhen your ribcage is structurally less able to expand, you compensate by recruiting more accessory muscles and moving more through your lower thoracic and lumbar spine. That compensation can overload tissues that are not designed for the extra work, producing spasms in exactly the spots where breathing and spinal movement overlap.
Pleurisy and Other Organ-Related Causes
Not every breathing-related back spasm starts in a muscle or a joint. The pleura, the thin membrane surrounding each lung, is richly supplied with pain-sensing nerves. When the pleura becomes inflamed (pleurisy), the friction of the two pleural surfaces sliding against each other during breathing produces sharp pain that makes you instinctively breathe shallowly and guard the affected side.
9PubMed Central. The Nature and Cause of the Pain of Pleurisy and PeritonitisThat guarding response involves contracting the muscles on the affected side of the back and chest, which can feel like a spasm and can itself become painful if sustained.
Pleurisy is usually caused by a viral infection, but it can also accompany pneumonia, a pulmonary embolism, or autoimmune conditions. The pain tends to be one-sided, knife-like, and dramatically worse with deep breathing, laughing, or coughing. If you have these symptoms along with fever, a recent respiratory illness, or sudden shortness of breath, the cause may be in the lung rather than the muscle.
Visceral organs can also refer pain to the back in ways that mimic a musculoskeletal spasm. Gallbladder inflammation classically sends pain to the right shoulder blade area. Kidney stones can cause flank pain that intensifies with deep breathing because the diaphragm presses on the kidneys during inhalation. Gastric conditions sometimes produce upper-back discomfort that people interpret as a muscle issue. The mechanism behind this referred pain involves shared nerve pathways between the organ and the overlying muscles, which can cause the brain to mislocate the signal.
Red Flags That Warrant Urgent Attention
Most breathing-related back spasms are musculoskeletal and resolve with time. But a few presentations should send you to a doctor promptly. Pulmonary embolism, a blood clot in the lung, is a potentially life-threatening condition that can present atypically as shoulder or back pain rather than the classic chest pain and shortness of breath.
10PubMed Central. Pulmonary Embolism Presenting As Shoulder and Back Pain: A Case ReportA systematic review of red flags in thoracic and lumbar pain identified a range of warning signs that increase the probability of a serious underlying condition. These include:
- Neurological signs: numbness, tingling, weakness in the legs, or loss of bladder or bowel control
- Systemic symptoms: unexplained weight loss, fever, night sweats, or pain that is constant and does not change with position
- Cardiovascular clues: rapid heart rate, low blood pressure, sudden shortness of breath, or pain that worsens with exertion but not with spinal movement
- History factors: recent surgery or immobilization, known cancer, prolonged corticosteroid use, or a family history of heart or lung disease
No single red flag is highly accurate on its own, but combinations of them substantially increase the likelihood that something serious is going on.
11PubMed. The diagnostic value of Red Flags in thoracolumbar pain: a systematic reviewIf your breathing-related back pain came on suddenly without a clear mechanical trigger, or if it is accompanied by any of the symptoms listed above, get it evaluated before assuming it is a muscle spasm.
What Actually Helps
For the majority of cases where the spasm is musculoskeletal, recovery involves breaking the pain-spasm cycle and restoring normal movement. In the acute phase, gentle movement is better than complete rest. Lying still for days allows the muscles to stiffen further, while careful, controlled movement promotes blood flow and prevents the compensatory patterns that feed the cycle.
Thoracic mobilization, where a physical therapist applies gentle pressure to restore movement in the stiff segments of the thoracic spine, has been shown to improve lung function measures like forced vital capacity and chest wall expansion in people with chronic low back pain, significantly more than exercise alone.
12PubMed. Effect of thoracic mobilization on respiratory parameters in chronic non-specific low back pain: A randomized controlled trialGetting the thoracic spine moving properly again reduces the compensatory load on the muscles, which gives them a chance to relax and heal.
Diaphragmatic breathing exercises are another tool with good evidence behind them. A randomized trial found that adding diaphragmatic breathing exercises to a core stabilization program improved pain, muscle activation, disability scores, and chest expansion in people with chronic low back pain, more so than core exercises alone.
13PubMed Central. Effect of Adding Diaphragmatic Breathing Exercises to Core Stabilization Exercises on Pain, Muscle Activity, Disability, and Sleep Quality in Patients With Chronic Low Back Pain: A Randomized Control TrialThe basic technique is straightforward: lie on your back with your knees bent, place one hand on your chest and one on your belly, and breathe so that the belly hand rises while the chest hand stays relatively still. This shifts the breathing load from the accessory muscles back to the diaphragm, reducing tension in the very muscles that are prone to spasm.
Over-the-counter anti-inflammatory medications can help dull the pain and reduce inflammation in the acute phase, making it easier to move and breathe normally. Heat packs applied to the area of spasm increase blood flow and help relax the muscle. Ice is sometimes recommended in the first 24 to 48 hours if there is noticeable swelling, though for most back spasms heat tends to feel more relieving.
Why Sleeping and Waking Up Can Be the Worst
If you have noticed that the spasm is worst first thing in the morning or when you roll over in bed, you are not imagining it. During sleep, you spend hours in a fixed position, which allows the injured or spasming muscles to stiffen. Your breathing rate and depth change during different sleep stages, and transitions between stages can involve sudden deeper breaths that catch a tense muscle off guard. Additionally, lying flat changes the load distribution on the thoracic spine compared to sitting or standing. If a disc is slightly bulging or a facet joint is inflamed, the recumbent position may bring it into closer contact with a nerve root, making each breath more provocative.
Sleeping with a pillow between your knees (side-lying) or a small rolled towel under the curve of your lower back (lying face-up) can reduce spinal loading enough to keep the spasm from waking you. Some people find that sleeping slightly inclined, with the head of the bed elevated a few inches, eases the pain because it keeps the thoracic spine in a slightly flexed position that opens up the space around the nerve roots.
When Coughing or Sneezing Makes Everything Worse
A cough or sneeze generates a sudden, forceful contraction of the abdominal and thoracic muscles, and it spikes the pressure inside the spinal canal. If you already have a strained intercostal muscle or an irritated nerve root, that pressure spike can produce a dramatic flare of pain and spasm that takes your breath away. This is why respiratory infections that involve persistent coughing can turn a minor muscle tweak into a weeks-long ordeal.
Bracing yourself before you cough or sneeze can help somewhat. Press a pillow against your ribs on the affected side, or cross your arms firmly over your chest. This externally stabilizes the ribcage and limits how much the intercostal muscles have to stretch during the explosive exhalation. It does not eliminate the pain, but it tends to take the edge off enough that you can get through a coughing spell without triggering a full spasm cycle. If you are recovering from a rib-area strain and develop a cold, consider asking your doctor about a short course of cough suppression to protect the healing tissue.