(CNN) -- English Premier League side Aston Villa have confirmed that Martin O'Neill has resigned as manager of the club.
The Northern Irishman led Villa to sixth place in the league for the past three seasons but has decided to walk out of the club just five days before the start of the new season.
O'Neill took over at Villa Park in August 2006 and was afforded millions to spend in the transfer market by the club's American owner Randy Lerner.
But a year ago midfielder Gareth Barry was sold to Manchester City, and England international James Milner is reportedly on the verge of following Barry to Eastlands.
There was speculation that O'Neill was only persuaded to stay at the end of last season after talks with Lerner but now his departure has been confirmed.
A statement on the club's official website read: "Aston Villa can confirm that Martin O'Neill has resigned as manager of the football club with immediate effect.
"Kevin MacDonald, reserve team manager, has assumed the role of caretaker manager and will prepare the team for the opening Barclays Premier League game of the season against West Ham on Saturday at Villa Park."
O'Neill said: "I have enjoyed my time at Aston Villa immensely. It's obviously a wrench to be leaving such a magnificent club.
"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 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."
O'Neill transformed Villa into genuine contenders to finish in the top four and qualify for the European Champions League but he couldn't secure the club's first trophy since 1996.
Villa lost 2-1 to Manchester United in last season's Carling Cup final and were beaten in the FA Cup semifinal by eventual winners Chelsea.
Before Villa, O'Neill had successful spells with English clubs Wycombe Wanderers and Leicester City, as well as Scottish giants Celtic. He can boast eight major trophies and three promotions in his 20-year long managerial career.
Paul Faulkner, chief executive of Aston Villa, added: "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."