The Russian, who returned last month from a 15-month doping ban, had her request for a French Open wild card rejected by Roland Garros officials earlier this week.
Having elected not to request a wildcard for Wimbledon, Sharapova will have to progress through three qualifying rounds to play in SW19's main draw.
The five-time Grand Slam champion will join fellow top WTA Tour stars including Angelique Kerber, Johanna Konta, Garbine Muguruza and Karolina Pliskova in a heavily stacked field at the Edgbaston Priory Club, though attention will now swiftly turn towards her participation at Wimbledon.
"We have received a two-year commitment from one of the most famous athletes in the world, Maria Sharapova, to play the Aegon Classic", LTA Chief Executive Michael Downey said.
The All England Club's tennis sub-committee - which is due to make a decision on all Wimbledon wild cards on June 20 - has always been known to be sceptical about Sharapova's case.
On Tuesday, two-times French Open champion Sharapova was unexpectedly snubbed by organisers who decided against giving her a wildcard into the main draw or the qualifying event of this year's tournament, which begins on May 28. I am so grateful and excited to be playing the event again!
"In return we are providing Maria with a main draw wildcard for this year".
"However Maria has served her ban in full and is now back playing high quality tennis".
Sharapova will also be at the tournament next year, with the event seen as one of the build-ups to Wimbledon. Wimbledon donates a large share of its profits to the LTA but the grand slam oversees its own tournament independently of the governing body.
Maria Sharapova, of Russian Federation, serves the ball to Mirjana Lucic-Baroni, of Croatia, during the Italian Open tennis tournament, in Rome, Tuesday, May 16, 2017.
"All players receive ranking points and prize money and there is more money and ranking points on offer the more matches that they win", said Wimbledon's website.
She has denied using it for any performance-enhancing goal, and an initial two-year ban was cut on appeal to the Court of Arbitration for Sport, which concluded that while she committed an anti-doping violation there was "no significant fault" on her part.