A gland is an organ in the human or animal body that secretes particular chemical substances for use in the body or for discharge into the surroundings. Liver is considered a gland because it produces a natural substance needed to digest fats. This substance is also known as bile. Its salts break up fat into smaller pieces so they can be absorbed more easily in the small intestine.

However, liver is also an organ. Let's analyze the definition of the word "organ":

An organ is a part of an organism that is typically self-contained and has a specific vital function, such as the heart or liver in humans.

Note from anatomy: A human liver normally weighs 3.2 – 3.7 lbs. Liver is both the heaviest internal organ and the largest gland in the human body.

More Info: en.wikipedia.org