After serving a 15-month suspension for using the banned substance meldonium, the former Wimbledon victor is ranked 211th in the world and does not have enough points to make the tournament's main draw.
Sharapova was this week told that she would not be granted a wildcard invite to the French Open which starts later this month.
She said she would not request a wild card for Wimbledon - although the cashed-up Grand Slam tournament would not have had the same commercial reason as Birmingham to grant her one.
Speaking about the announcement on Thursday, LTA Chief Executive Michael Downey said: "We have received a two-year commitment from one of the most famous athletes in the world, Maria Sharapova, to play the Aegon Classic Birmingham. I am so grateful and excited to be playing this event again!" read a statement on her official website.
Sharapova won the title in Birmingham in 2004 and 2005.
Sharapova has moved to prevent a similar scenario happening at Wimbledon, announcing that she will take part in the preliminary rounds at Roehampton in the week leading up to the main tournament.
Maria Sharapova has been handed a wildcard entry for the Aegon Classic Birmingham, two days after being overlooked for the French Open.
Much debate has surrounded Sharapova over whether she should be given wildcards to competitions following her return.
All England Club chairman Philip Brook said on May 3: "We will wait and see whether Maria applies for a wild card and, if so, we will consider the case alongside everyone else's".
The British No.1 was facing the American for the first time since March, when victory sent her into the Miami final.
Wimbledon qualifying starts on June 26 and Sharapova will need to win three matches to enter the main tournament.
Sharapova will first though have to deal with a thigh injury that saw her withdraw from the Italian Open just hours after being rejected by the French Open. But she was no match for Williams in a powerful first set in which the 36-year-old broke twice while saving the solitary break point on her serve.