She immediately responded by saying she would appeal the decision.
The ruling by an independent three-person panel appointed by the ITF said Sharapova, 29, did not intend to cheat but that she bore "sole responsibility'' and "very significant fault'' for the positive test.
"The ITF tribunal unanimously concluded that what I did was not intentional," Sharapova said in a statement. "The tribunal found that I did not seek treatment from my doctor for the purpose of obtaining a performance enhancing substance. The ITF spent tremendous amount of time and resources trying to prove I intentionally violated the anti-doping rules and the tribunal concluded I did not. You need to know that the ITF asked the tribunal to suspend me for four years -- the required suspension for an intentional violation -- and the tribunal rejected the ITF's position."
The ITF, last month before the tribunal, asked for Sharapova to be suspended for four years, but the rules state that she could not be suspended for longer than two years if it was deemed that her use of the drug was not intentional.
"I cannot accept an unfairly harsh two-year suspension," Sharapova said. "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."
The WTA issued a statement on the ruling, saying in part, "It is important at all times for players to be aware of the rules and to follow them. In this case, Maria has taken responsibility for her mistake from the outset. The WTA supports the process that the ITF and Maria have followed."
Sharapova and the Russian team had hoped she would be cleared in time to compete at the Olympics in Rio de Janeiro in August, but after the ruling, Russian Tennis Federation president Shamil Tarpischev told the Tass news agency that Ekaterina Makarova would replace her.
She was provisionally suspended by the ITF in March, when she announced she failed a doping test in January,at the Australian Open. Sharapova maintained that she was unaware that the drug she had been taking since 2006, mildronate, was also known as meldonium. That drug became a banned substance on the World Anti-Doping Agency's list as of Jan. 1.
Her lawyer, John Haggerty, said Sharapova took the substance after that date.
In addition to Sharapova's testing positive at the Australian Open, the ITF said she also failed a test for meldonium in an out-of-competition control in Moscow on Feb. 2.
"I am disappointed that the ITF tribunal gave Maria an unfairly harsh suspension because she is such a famous athlete and they wanted to make an example out of her," Haggerty said in a statement Wednesday, adding that he believes Sharapova's suspension will be reduced at her appeal.
Sharapova said in March she had started using the drug, which boosts blood and oxygen flow, under a doctor's guidance a decade ago because of irregular electrocardiogram results and a family history of heart issues and diabetes.
The governing body argued that Sharapova's records with the doctor ended in 2013, yet she continued to take the drug.
The appeal will be sent to the Court of Arbitration for Sport, where three judges will make the ruling. Both Sharapova and the ITF get to choose one of the judges. The decision will be binding.
By rule, Sharapova had to be suspended at least one year because she did not dispute that she took mildronate after Jan. 1, when it appeared on the banned list.
The sentence will be retroactive to the Australian Open, so if Sharapova's original suspension is kept, she will sit out through the 2018 Australian Open. That would mean she would be 31 years old when she competes in her next Grand Slam tournament.
A five-time major winner, Sharapova's last big win came at the 2014 French Open. She hasn't played since a quarterfinal loss to Serena Williams at the Australian Open and is ranked 26th this week.
The tribunal's ruling, as long as it's not reversed on appeal, could be worth a lot of money to Sharapova because of the finding that her use wasn't performance-enhancing. When she announced her positive test, her endorsement deals with Nike and Porsche were suspended.
Nike said in a statement Wednesday that it had lifted her suspension based on ITF's findings, but did not know whether it planned to use her soon. "Based on the decision of the ITF and their factual findings," the statement said, in part, "We hope to see Maria back on court and will continue to partner with her."
Those deals would be harder to sever without compensation. Her other endorsers, Evian and Head, have continued using her, while watchmaker Tag Heuer elected not to renew its deal at the start of this year. Despite Sharapova being off the court, the narrative of her suspension could affect her own brand; her "Sugarpova" line of gummy candy and most recently chocolate have gained worldwide distribution.
The Associated Press contributed to this report.
Sharapova's disregard leads to two-year ban for doping
Brad Gilbert breaks down the two-year suspension handed to Maria Sharapova by the International Tennis Federation for testing positive for the banned substance meldonium and timeline for Sharapova's appeal.