Core Concept Human Health Published: January 29, 2019

How Do Bacteria Fight Back Against Viruses?


Bacteria vs. viruses is one of the oldest fights on Earth. Certain viruses need to infect bacteria in order to reproduce, but the bacteria do not want to be infected. How do bacteria that survive viral infection make sure that it does not happen again? Many kinds of bacteria have developed a process called CRISPR that helps them remember viruses they have seen before. CRISPR also allows bacteria to keep the virus from destroying them. While humans do not have CRISPR in their cells, they have figured out some exciting ways to use CRISPR in the lab.

Bacteria vs. Viruses: The Biggest Tiniest War

You have probably heard of bacteria and viruses that cause human diseases, and you may know about how humans fight bacteria with antibiotics and how we prevent infections by both bacteria and viruses using vaccines. But bacteria and viruses have also been fighting each other for a very long time, and studying the way they fight has taught us a lot about how organisms change over time and has also led to the discovery of an extremely exciting research tool.

This battle between bacteria and viruses is about the ability to reproduce. Both bacteria and viruses reproduce by making identical copies of themselves, and the instructions for doing this are stored in their DNA.

Cracking the DNA Code

DNA is a long molecule that is built from a combination of four smaller molecules: adenine, thymine, guanine, and cytosine (A, T, G, and C for short; Figure 1). The A, T, C, and G molecules can be strung together in many different orders to make a long strand. That specific combination of As, Ts, Gs, and Cs is like a code. One DNA strand on its own will not last very long in a cell, so strands pair up according to specific rules. As can only pair with Ts, and Cs can only pair up with Gs, so the two strands end up being sort of like opposites of one another. The two strands of a DNA molecule are complementary. The two complementary strands twist around each other to form a structure called a double helix.

Figure 1 - DNA structure and how proteins are made from DNA.
  • Figure 1 - DNA structure and how proteins are made from DNA.
  • (A) A strand of DNA contains a sequence of molecules (A, T, C, and G) in a certain order. Two complementary strands of DNA pair up (A matches with T and C matches with G) and twist around each other to make a shape called a double helix. (B) To make a protein, first, a DNA molecule goes through a process called transcription, to make an RNA molecule. The RNA molecule then uses cellular machinery to create a protein, a process known as translation.

Some sections of DNA, called genes, contain the instructions for building proteins (Figure 1). Proteins are the main molecules that do things in a cell. Proteins help turn our food into energy, they move things around inside and between cells, and they help cells communicate. The protein products of genes and the jobs they do are how genes result in physical traits, like eye color or straight or curly hair.

A lot of our DNA is not actually genes, though. Many of these other sections of DNA help the cell know when to make a certain protein, and how much of that protein they should make.

But What Has DNA Got to Do With It?

So, now that we know that DNA codes for proteins, we can think about how that might allow a bacterium or virus to make a copy of itself. For a bacterium to reproduce, it needs to make enough proteins and molecules for another cell, copy its DNA so that the new cell will have the information it needs, and it also needs to get bigger and divide. A virus, in comparison, is much simpler—just some DNA in a protein coat. Both bacteria and viruses have instructions for making all the proteins that will help all the tasks of reproduction. So what is there to fight about?

We are missing one important part of this story—how does a protein get made? It happens with the help of a molecule called RNA. RNA is very similar to DNA, but it only has one strand. Special proteins can make (or “transcribe”) RNA versions of genes which can be “read” by cellular machinery that “translates” the RNA code and builds a protein (Figure 1). You can think about the difference between RNA and DNA like this: DNA is like an instruction manual, or a blueprint, or a cookbook. No changes are made to the master copy, but if someone wants to make something with these instructions, small portions are copied and sent to where the product can be made from the proper materials. That is the job of RNA. It is this intermediate RNA step that causes problems for viruses and bacteria. Bacteria have the instructions and the tools for making proteins, but viruses only have the instructions—no tools.

The way some viruses make up for this is by hijacking bacteria and using their tools (Figure 2). This kind of virus lands on and attaches to the outside of the bacterium and injects its DNA into the bacterium. If the bacterium does not realize that the viral DNA is not its own, it will follow the instructions in the viral DNA and make more viruses. The bacterium will make copies of viral DNA and lots of virus proteins and will allow the new viruses to assemble inside the bacterium. Finally, the new viruses burst open the bacterium and go out to infect more bacteria [1].

Figure 2 - How does a virus reproduce?
  • Figure 2 - How does a virus reproduce?
  • Step 1: The virus attaches to the outside of the bacterium and injects its DNA into the bacterium. Step 2: New viral DNA and protein are produced by the bacterium. Step 3: New viruses assemble inside the bacterium. Step 4: New viruses burst out of the bacterium to go on and infect other bacteria.

Most bacteria that get infected by a virus they have never seen will die. Every so often, though, a bacterium does not die from viral infection. This might happen because of a mutation in that bacterium’s DNA. Mutations are changes to the DNA sequence of a gene, like little mistakes, and they happen all the time in bacteria when they are copying their DNA for the next generation. Some of those mistakes kill the bacterium, so it does not get the chance to pass the mutation on to the next generation. Other mutations, however, might just slide by unnoticed … until the bacterium gets invaded by a virus! Suddenly it turns out that the mutation actually helps the bacterium fight off the virus. The lucky few bacteria that have this helpful mutation are the ones that survive to reproduce, and they pass on those helpful mutations to their offspring. Those offspring in turn reproduce, and eventually the helpful mutation is present in most of the bacteria in the population. This introduction of a helpful new version of a gene into a whole group of bacteria is an example of evolution.

CRISPR: Defending Bacteria by Remembering Viruses

At this point, you may be wondering what resistance to viruses looks like in bacteria, and this is where CRISPR comes in (Figure 3). CRISPR stands for Clustered Regularly InterSpaced Palindromic Repeats. That sounds really fancy, but it is actually just a description of some special regions of bacterium DNA. At these regions, there are two kinds of DNA sequences that alternate: repeats and spacers. Repeats are the same collection of letters repeated over and over, but the spacers in between them are all different.

Figure 3 - What is CRISPR and how does it work?
  • Figure 3 - What is CRISPR and how does it work?
  • (A) Structure of CRISPR. Short sections of DNA called repeats and spacers are arranged in an alternating pattern. The repeats (here the black diamonds) are all the same, but the spacers (the colorful rectangles) are all different. Cas genes are also found near the CRISPR region. (B) In the first infection, a short sequence from viral DNA is copied to become a new spacer. The new spacer is incorporated into CRISPR. (C) In the second infection, the bacterium produces an RNA from the CRISPR region. The RNA guides a cas protein to the viral DNA, and the cas protein destroys the viral DNA.

When scientists first found these special regions of DNA, they were not sure what their purpose was. But soon they realized that the spacers were often very similar to viral DNA. Where did this viral DNA come from? Could CRISPR possibly help bacteria recognize and fight viruses?

In 2007, Rodolphe Barrangou and his lab decided to explore this idea (Fun fact: Barrangou worked for a yogurt company! Making yogurt requires bacteria, and sometimes those bacteria get wiped out by viruses. It was in the interest of the company to know how bacteria protect themselves from viruses [2]). When Barrangou compared the CRISPR region of one non-virus-resistant type of bacteria to that of a virus-resistant version of the same species, they found out that the only difference between them was that the virus-resistant version had some extra spacers. They decided to do an experiment to figure out where these extra spacers came from.

First, they exposed non-virus-resistant bacteria to viruses until the bacteria became virus-resistant. When they compared the CRISPR regions of the newly-resistant and non-resistant bacteria, they found that there were usually one to four new spacers in the resistant bacteria, and that those new spacers were similar to the DNA of the viruses the bacteria had been exposed to. This made the researchers think that the spacers might have been made from the viral DNA.

Barrangou and his lab also deleted and inserted several spacers that matched different viruses. They found that when they deleted a spacer from a virus-resistant bacterium, that bacterium lost its resistance to the matching virus, and when they added spacers, the bacterium would be resistant to the matching virus, even if it had never seen that virus before. Barrangou and his lab concluded that the spacers in CRISPR regions provide resistance to viruses by saving some of the viral DNA, which allows the bacterium to “remember” them [3].

The resistance to the virus (immunity) arises in response to infection. Normally, immunity is not passed to offspring, but with CRISPR, it can be, because the immunity is actually encoded in the DNA, which is passed on through the generations [4].

Since Barrangou did his first CRISPR experiments, we have figured out a lot about how CRISPR works to prevent viruses from destroying the cell. The bacterium clips a bit of the viral DNA and adds it into a CRISPR region of its own DNA. If the virus comes back, the bacterium makes RNA from the region of CRISPR specific for that virus. These RNA copies pair up with some cas (CRISPR-associated) proteins. The RNA guides the cas protein to the invading viral DNA, so the protein can destroy it. No more viral DNA, no new viruses. These RNA copies pair up with some cas (CRISPR-associated) proteins, which are made from cas genes.

Beyond Bacteria: CRISPR in the Lab

When this mechanism was discovered, scientists quickly realized that CRISPR could have many interesting and exciting uses in the lab [2]. People figured out that they could give a cas protein the RNA version of any piece of DNA they wanted it to find, and with the RNA’s help, the protein would go there and make changes to the DNA. Cas proteins can change one letter, which is often enough to make the gene not work anymore, or cas proteins can delete a whole gene or section of a gene.

This makes CRISPR an awesome tool for genetics, which is the study of inherited traits. One of the ways geneticists figure out how genes work is by deleting or inactivating them and seeing what goes wrong in the organism. This has been done for many years, but CRISPR allows us to do this faster and more accurately than ever before.

It is also possible that CRISPR could be used to correct harmful mutations that cause disease in humans, but this raises some serious ethical questions. How will we decide when to use this technology? And is it okay to make genetic changes that can be inherited by an individual who did not consent to those changes? We are still a long way away from CRISPR in humans, but it is important to ask these questions sooner, rather than later.

Author Contributions

MC wrote the manuscript and generated all figures. JJ supervised the work and commented on the manuscript at all stages. Both authors reviewed the final manuscript.


DNA: Deoxyribonucleic acid, a long molecule made up of a combination of four smaller molecules (A, C, T, and G) that encodes all the information in the cell.

Double Helix: The shape DNA forms when the two complementary strands of the molecule pair up and twist.

Gene: A section of DNA that codes for a protein.

Protein: A class of large, structurally complicated molecules that is responsible for much cellular activity.

RNA: Ribonucleic acid, a single stranded molecule made from As, Gs, Cs, and Us. RNA can serve as a messenger between DNA and the cellular machinery that makes proteins, but it has other functions, too.

Mutation: A change to an organism’s DNA sequence, such as the addition, swap, or deletion of an A, C, T, or G.

CRISPR (Clustered Regularly Interspaced Palindromic Repeats): The name given to a special region of some bacterial genomes that contains alternating spacer and repeat sequences. It is also the name given to a process by which bacteria defend themselves from viral infections and for a laboratory technology that allows genes to be edited.

Cas Genes: CRISPR-associated genes adjacent to CRISPR loci of spacers and repeats. cas9 is a cas gene.

Conflict of Interest Statement

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.


[1] Salmond, G. P. C., and Fineran, P. C. 2015. A century of the phage: past, present and future. Nat. Rev. Microbiol. 13:777–86. doi: 10.1038/nrmicro3564

[2] Zimmer, C. 2015. Breakthrough DNA Editor Born of Bacteria. Quanta Magazine. Available online at: (accessed November 26, 2017).

[3] Barrangou, R., Fremaux, C., Deveau, H., Richards, M., Boyaval, P., Moineau, S., et al. 2007. CRISPR provides acquired resistance against viruses in prokaryotes. Science 315:1709–12. doi: 10.1126/science.1138140

[4] Barrangou, R., and Marraffini, L. A. 2014. CRISPR-Cas systems: prokaryotes upgrade to adaptive immunity. Mol. Cell 54:234–44. doi: 10.1016/j.molcel.2014.03.011