The Russian said she had been taking the banned substance meldonium from a family doctor over the past 10 years before it was put on WADA's (Word Anti-Doping Agency) banned list at the start of the year.
Sharapova - the richest sportswoman in the world, earning £21m last year - faces a ban which media commentators were speculating would only be for the rest of the year.
"An Independent Tribunal appointed under Article 8.1 of the 2016 Tennis Anti-Doping Programme (the "Programme") has found that Maria Sharapova committed an Anti-Doping Rule Violation under Article 2.1 of the Programme and as a consequence has disqualified the affected results and imposed a period of ineligibility of two years, commencing on 26 January 2016," said the International Tennis Federation in a statement.
"Ms. Sharapova, a 29-year-old player from Russia, provided a urine sample on 26 January 2016, after her quarter-final match at the 2016 Australian Open in Melbourne, Australia.
"That sample was sent to the WADA-accredited laboratory in Montreal, Canada for analysis, and was found to contain meldonium, which is a metabolic modulator that is included under section S4 (Hormone and Metabolic Modulators) of the 2016 WADA Prohibited List, and therefore is also prohibited under the Programme."
Sharapova intends to appeal the decision to the Court of Arbritration for Sport after claiming the ITF had pushed to suspend the Russian Grand Slam winner for four years, only for a tribunal to decide upon a two-year suspension after, Sharpova claimed, they accepted she did "not do anything intentionally wrong".
""While the tribunal concluded correctly that I did not intentionally violate the anti-doping rules, I cannot accept an unfairly harsh two-year suspension," said Sharapova in a statement. "The tribunal, whose members were selected by the ITF, agreed that I did not do anything intentionally wrong, yet they seek to keep me from playing tennis for two years. I will immediately appeal the suspension portion of this ruling to CAS, the Court of Arbitration for Sport."
The suspension starts from January 26 when she failed the test, but the length of the suspension must place huge doubts over Sharapova's career at the top level.
It is a huge amount of time to spend out of the sport, especially in what is regarded as the latter stages of her career.
The five-times Grand Slam champion has not competed since she lost to Serena Williams in the quarter-finals of the Australian Open in January. Her results at this year's Australian Open have also been disqualified.
She has struggled with injuries in recent years before she failed the drugs test.