Hepatitis B virus causes inflammation of the liver. The virus spreads through contact with infected body fluids, such as through sexual intercourse, open cuts, or scratches, or from mother to baby at birth. Most people do not realize that they have been infected until chronic inflammation causes complications, such as liver scarring or cancer. A hepatitis B vaccine can boost the body's immune response to the virus and help protect against infection. The vaccine is recommended for people at high risk for infection. Some research shows that the vaccine protects against infection for up to 10 years. It is not known whether the protection lasts longer than 10 years.