O'Neill led Villa to sixth in the Premiership last season and the Carling Cup final
Martin O'Neill has resigned as Aston Villa manager with immediate effect.
Kevin MacDonald has been appointed caretaker boss while no reason has been given for O'Neill's decision to leave after four years in the job.
MacDonald will prepare the side for their Premier League opener against West Ham on Saturday.
O'Neill, appointed in 2006, said: "I have enjoyed my time at Aston Villa immensely. It's obviously a wrench to be leaving such a magnificent club."
The 58-year-old O'Neill, who led Villa to their third successive sixth-placed finish in the Premier League last season, added: "I would like to pay tribute to the Villa players, my coaching staff and the Villa supporters for all the support and encouragement they have given both the club and me personally during my time as manager.
I'm shocked like everyone else even though I've been aware that behind the scenes that there has been a lack of togetherness
Former Villa manager Graham Taylor
"I wish them all the best for the future. I will obviously be assisting the club in the immediate short-term with regard to the handover of my duties."
In May, Villa owner Randy Lerner insisted O'Neill had pledged his future to Villa in after much speculation over whether or not the former Celtic boss would quit.
Northern Irishman O'Neill has transformed the fortunes of Villa since replacing David O'Leary in August 2006, culminating in an appearance in the final of last season's Carling Cup, their first Wembley final for 10 years.
Lerner had backed O'Neill in the transfer market during that spell but it became clear this summer that similar investment would not be forthcoming.
Lerner insisted that Villa would have to adopt a sell-to-buy policy and O'Neill was resigned to losing the services of midfielder James Milner to Manchester City. Former skipper Gareth Barry also moved to Eastlands last year.
Former Wycombe, Leicester and Celtic boss O'Neill indicated before the weekend that he was keen to speak to Lerner over how much cash he would make available from the Milner move.
When asked how much he would have to spend on new players, O'Neill said: "I need to speak to the chairman [Lerner] and chief executive [Paul Faulkner] about that.
"For a number of days in this transfer saga with Manchester City, you have known my position in terms of what I have been advocating and thinking about."
It is unclear at this stage whether the response O'Neill received from the club's hierarchy led to his decision to end his four-year reign at the Midlands club.
Former England manager Graham Taylor, who had two spells as Villa manager, told BBC Sport he had been aware of some unrest at the club during the off-season.
"I'm shocked like everyone else even though I've been aware that behind the scenes that there has been a lack of togetherness," said Taylor, who was in charge at Villa Park between 1987-90 and 2002-03.
"Whether this has anything to do with James Milner and his possible transfer to Manchester City and the fact that we are led to believe that he may have to sell to buy, I don't know."
Taylor also urged Villa not to rush into appointing a replacement, with the likes of US coach Bob Bradley, Ajax boss Martin Jol and former England manager Sven-Goran Eriksson all being mentioned as potential successors.
"It is always a little bit dangerous to rush into appointing a new manager but especially as this is an acute time before the start of the season," added Taylor.
"It is a bad time to lose your manager before the start of the season and one has to be careful about who you appoint."
Faulkner said of O'Neill's departure: "The club would like to thank Martin for the great work he has done at Aston Villa over the past four years.
"He has helped to establish the club in the upper echelons of the Premier League, has taken us to Wembley and we have also qualified for European competition for the past three seasons under his management. We wish him the best in the future."
League Managers' Association chief executive Richard Bevan said: "The LMA shares Martin's disappointment at him leaving Aston Villa.
"He has achieved great success not just with Villa but throughout his managerial career. He is a great example to all aspiring managers having built the foundations in non-league football to then go on to successfully manage at the highest level in the game."
Former Villa captain Martin Laursen said he was not surprised that O'Neill left the club also adding that he did not think his departure would be followed by several players.
"He wanted more than Randy Lerner could give him," Laursen told BBC Sport.
"He is so ambitious that when he doesn't get what he wants he walks away. But I don't think more players will leave.
"If Martin O'Neill gets another important job then he might take some with him but I don't think players will leave because O'Neill has gone."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.