When the inside of your mouth gets hurt or irritated, bacteria may enter and cause an infection. Sometimes you will see a painful swelling filled with pus (a thick, yellowish fluid). If the pus can’t drain out, the area will get more swollen and painful. This is known as an abscess. The abscess forms a barrier around the infection. This is one way that your body tries to keep a bacterial infection from spreading.

Abscesses can form very quickly. Sometimes they form only one or two days after the infection starts. There are two types of abscesses:

A gum abscess (also called a periodontal abscess) usually is caused by an infection in the space between the tooth and gum. The infection may occur after food gets trapped between the gum and tooth. In people with severe periodontal disease, bacteria can build up under the gum and in the bone.

A tooth-related abscess (also called a periapical abscess) occurs inside the tooth. This happens when the tooth’s nerve is dead or dying. This type of abscess shows up at the tip of the tooth’s root. Then it spreads to the surrounding bone.

Most abscesses are painful, so people usually seek treatment right away. Sometimes the infection causes little or no pain. If an abscess is not treated, the infection can last for months or even years. It will not go away on its own, so it’s important not to ignore the symptoms.

If the infection is not treated, it can damage the surrounding bone and teeth. A hollow tunnel sometimes forms through the bone and skin to allow pus to drain. This tunnel is called a fistula or “sinus tract.” You might see or feel this opening inside your mouth. It looks like a pimple. If you have pus draining through a fistula, you might notice a strange taste in your mouth.

Sometimes, an abscess that isn’t treated can form a fluid-filled bubble (cyst) in the jaw bone. If the tooth is severely broken down and can’t be saved, the cyst may come out when the tooth is extracted. If the tooth can be saved, you will need a root canal to remove the infected nerve. If this treatment does not heal the cyst, you may need surgery to remove it.

In rare cases, the infection that causes an abscess may spread and lead to serious health problems.