The five-time Grand Slam champion was provisionally suspended by the International Tennis Federation (ITF) in early March, when she announced at a news conference in Los Angeles that she failed a doping test in January.
Sharapova said then she was not aware that the World Anti-Doping Agency had barred athletes from using meldonium, also known as mildronate, as of January 1.
Her lawyer, John Haggerty, said Sharapova took the substance after that date.
Wednesday’s ruling said Sharapova did not intend to cheat, but bore ”sole responsibility” and ”very significant fault” for the positive test.
In addition to testing positive at the Australian Open, she also failed a test for meldonium in an out-of-competition control in Moscow on February 2, the ITF said.
The two-year ban can be appealed to the Court of Arbitration for Sport.
Sharapova said she was first prescribed the Latvian-made drug, typically used for heart conditions, for medical reasons in 2006. She could have been barred from competing for up to four years.
The ITF ruling in Sharapova’s case follows a hearing before a three-person panel. Lawyers representing the ITF argued their side, while Haggerty argued hers. He said she spoke at the hearing.
The ban throws into doubt the on-court future of Sharapova, a 29-year-old Russian who is one of the most well-known – and, thanks to a wide array of endorsements – highest-earning athletes in the world.