The offer on Thursday night from the British Lawn Tennis Association (LTA) was a boost for the 30-year-old Russian after the French tennis federation (FFT) refused her request to circumvent the rankings and play in the main draw.
Sharapova returned from a 15 month doping ban in April and tournament organisers in Stuttgart, Madrid and Rome have given her wildcards.
But the FFT boss, Bernard Giudicelli, said there would be no such favours despite her two titles at the clay court showpiece because she was working her way back from a doping violation rather than an injury.
Sharapova won the Birmingham event in 2004 and later claimed Wimbledon where she beat Serena Williams in the final.
Sharapova is guaranteed a place in the qualifying tournament for Wimbledon but has aksed for a wildcard into the main draw. Wimbledon organisers say they will decide on 20 June
"I am really excited to be coming back to Birmingham this year to play on the grass as part of my build-up to Wimbledon and I thank the LTA for this opportunity," said Sharapova. "I have some great memories of playing there over the years, including winning the title on two previous occasions."
LTA chief executive, Michael Downey, accepted there would be controversy over the decision as some of her rivals on the women's tour have openly questioned the favours handed out to Sharapova since her return from the doping ban for taking meldonium.
"We have received a two year commitment from one of the most famous athletes in the world to play the Aegon Classic Birmingham," said Downey. "In return we are providing Maria with a main draw wildcard for this year.
"This wasn't a decision we took lightly and we recognise not everyone will agree with it, however Maria has served her ban in full and is now back playing high-quality tennis."
The Birmingham event at the Edgbaston Priory club takes place between 17 and 25 June. Eight of the world's top 10 are set to take part, including the world number one Angelique Kerber.